Rebol Programming/does

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

USAGE:

[edit | edit source]
DOES body 

DESCRIPTION:

[edit | edit source]

A shortcut to define a function that has no arguments or locals.

DOES is a function value.

ARGUMENTS

[edit | edit source]
  • body -- The body block of the function (Type: block)

(SPECIAL ATTRIBUTES)

[edit | edit source]
  • catch

SOURCE CODE

[edit | edit source]
does: func [
    {A shortcut to define a function that has no arguments or locals.} 
    [catch] 
    body [block!] "The body block of the function"
][
    throw-on-error [make function! [] body]
]