Rebol Programming/spec-of

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

USAGE:

[edit | edit source]
SPEC-OF value 

DESCRIPTION:

[edit | edit source]

Returns a copy of the spec of a function.

SPEC-OF is a function value.

ARGUMENTS

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

SOURCE CODE

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