4 ms·
.. it's not intended to be a puzzle, so let me also show what memoize_impl ends up looking like: proc memoize_impl {pargs lambda} { set cmd [info l
by jepler 8y ago
.. it's not intended to be a puzzle, so let me also show what memoize_impl ends up looking like:
proc memoize_impl {pargs lambda} {
set cmd [info level 1]
if {[info exists ::MEM($cmd)]} { return $::MEM($cmd) }
set ::MEM($cmd) [apply [list $pargs $lambda] {*}[lrange $cmd 1 end]]
}