namespaces: simplify (box-at) using cache.
parent
2c41c913ee
commit
cc80c37bbb
|
@ -14,8 +14,7 @@ TUPLE: global-hashtable
|
||||||
TUPLE: global-box value ;
|
TUPLE: global-box value ;
|
||||||
|
|
||||||
: (box-at) ( key globals -- box )
|
: (box-at) ( key globals -- box )
|
||||||
boxes>> 2dup at
|
boxes>> [ drop f global-box boa ] cache ; foldable
|
||||||
[ 2nip ] [ [ f global-box boa ] 2dip [ set-at ] 2curry keep ] if* ; foldable
|
|
||||||
|
|
||||||
: box-at ( key globals -- box )
|
: box-at ( key globals -- box )
|
||||||
(box-at) { global-box } declare ; inline
|
(box-at) { global-box } declare ; inline
|
||||||
|
|
Loading…
Reference in New Issue