REBOL Programming/func

< REBOL Programming

USAGE:

FUNC spec body 

DESCRIPTION:

Defines a user function with given spec and body.

FUNC is a function value.

ARGUMENTS

(SPECIAL ATTRIBUTES)

SOURCE CODE

func: func [
    "Defines a user function with given spec and body." 
    [catch] 
    spec [block!] {Help string (opt) followed by arg words (and opt type and string)} 
    body [block!] "The body block of the function"
][
    throw-on-error [make function! spec body]
]
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.