Skip to content
angerangel edited this page Mar 19, 2013 · 1 revision

USAGE

   FUNCTION spec vars body

DESCRIPTION

Defines a user function with local words.

FUNCTION is a function value.

ARGUMENTS

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

#SOURCE

function: make function! [  [
    "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! copy/deep reduce [compose [(spec) /local (vars)] body]
] ]
Clone this wiki locally