Last modified on 27 October 2012, at 22:07

REBOL Programming/function

USAGE:Edit

FUNCTION spec vars body 

DESCRIPTION:Edit

Defines a user function with local words.

FUNCTION is a function value.

ARGUMENTSEdit

  • spec -- Optional help info followed by arg words (and optional type and string) (Type: block)
  • vars -- List of words that are local to the function (Type: block)
  • body -- The body block of the function (Type: block)

SOURCE CODEEdit

function: func [
    "Defines a user function with local words." 
    spec [block!] {Optional help info followed by arg words (and optional type and string)} 
    vars [block!] "List of words that are local to the function" 
    body [block!] "The body block of the function"
][
    make function! head insert insert tail copy spec /local vars body
]