references/sleep-functions/function.md

GitHub

function

Category: Utility

Source: https://sleep.dashnine.org/manual/function.html


Synopsis

& function('&name')

Obtains a reference to the specified function.

Parameters

'&name' - the name of the function to obtain the handle for.

Returns

$null if the function doesn't exit or a scalar containing the function object.

Examples

Example:

sub foo {
println("foo function w/ $1");
}

foo("new color protection");

$func = function('&foo');
[$func: "cool spikes"];

Output:

foo function w/ new color protection
foo function w/ cool spikes

See Also

&inline; &invoke; &setf