Jump to content

Rebol Programming/body-of

From Wikibooks, open books for an open world

USAGE:

[edit | edit source]
BODY-OF value 

DESCRIPTION:

[edit | edit source]

Returns a copy of the body of a function or object.

BODY-OF is a function value.

ARGUMENTS

[edit | edit source]
  • value -- (Type: any)

SOURCE CODE

[edit | edit source]
body-of: func [
    {Returns a copy of the body of a function or object.} 
    value
][
    case [
        object? :value [third :value] 
        function? :value [copy/deep second :value] 
        any-function? :value [none] 
        'else [cause-error 'script 'cannot-use reduce ['reflect type? :value]]
    ]
]