REBOL Programming/closure?

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

USAGE:[edit]

CLOSURE? value 

DESCRIPTION:[edit]

Returns TRUE if it is this type.

CLOSURE? is a function value.

ARGUMENTS[edit]

  • value -- (Type: any-type)

SOURCE CODE[edit]

closure?: func ["Returns TRUE if it is this type." value [any-type!]][
    all [
        function? get/any 'value 
        value: second :value 
        same? pick value 1 :do 
        same? pick value 2 :make 
        same? pick value 3 :function!
    ]
]