cached multimethod

Methods

cached(cb:Fun) Source: stdlib.ngs:6562
Cache cb results. Runs cb only once. TODO: Support arguments.

Returns

New function which wraps cb.

Example

my_func = cached( { expensive(); calculation(); steps(); result } )
use_result_of(my_func())
...
use_result_of(my_func())