setf

Synopsis

setf('&function', &closure)

Binds a closure to the specified function name.

Parameters

'&function' - a string consisting of a function name to bind the closure to.

&closure - the closure to bind to the specified function name. A value of $null will remove the function binding.

Side Effects / Notes

Examples

sub foo { println("foo!"); } setf('&foo', { println("bar!"); }); foo();

bar!

See Also