Last modified on 27 October 2012, at 22:08

REBOL Programming/func

USAGE:Edit

FUNC spec body 

DESCRIPTION:Edit

Defines a user function with given spec and body.

FUNC is a function value.

ARGUMENTSEdit

  • spec -- Help string (opt) followed by arg words (and opt type and string) (Type: block)
  • body -- The body block of the function (Type: block)

(SPECIAL ATTRIBUTES)Edit

  • catch

SOURCE CODEEdit

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]
]