Rebol Programming/title-of

From Wikibooks, open books for an open world
< Rebol Programming
Jump to navigation Jump to search

USAGE:[edit | edit source]

TITLE-OF value 

DESCRIPTION:[edit | edit source]

Returns a copy of the title of a function.

TITLE-OF is a function value.

ARGUMENTS[edit | edit source]

  • value -- (Type: any)

SOURCE CODE[edit | edit source]

title-of: func [
    "Returns a copy of the title of a function." 
    case [
        object? :value [cause-error 'script 'invalid-arg 'title] 
        any-function? :value [if string? value: pick third :value 1 [copy value]] 
        'else [cause-error 'script 'cannot-use reduce ['reflect type? :value]]