Returns an closure from a given string.
If no value is given, the default closure || nil
is returned.
This function does not generate a change.
closure(value)
Argument | Type | Description |
---|---|---|
value | str (optional) | Convert a string into a closure. If omitted the default closure || nil is returned. |
An new closure.
This code shows some return values for closure():
s = '|x| x*2';
c = closure(s);
c(21);
Return value in JSON format
42