Functions

Functions that make functions, leave them, and look into them. func and function differ in what a word set inside the body becomes: in function it is local by itself. See functions.

func

Makes a function from a spec and a body.

func spec body
  • spec (block!)

  • body (block!)

function

A function whose set-words in the body are local.

function spec body
  • spec (block!)

  • body (block!)

does

A function with no arguments.

does body
  • body (block!)

has

A function with only local words.

has locals body
  • locals (block!)

  • body (block!)

closure

Makes a function from a spec and a body.

closure spec body
  • spec (block!)

  • body (block!)

return

Leaves the function it is in, giving a value.

return value
  • value (any-type!)

exit

Leaves the function it is in, giving no value.

exit

apply

Calls a function with the arguments in a block.

apply func block
  • func (any-function!)

  • block (block!)

  • /only

spec-of

A copy of a function’s spec block.

spec-of value
  • value (any-function!)

body-of

A copy of a function’s body block, or none for a native; for an object, its fields as field: value.

body-of value
  • value (any-function! any-object!)