namespaces: simplify (box-at) using cache.

db4
John Benediktsson 2015-08-14 19:51:29 -07:00
parent 2c41c913ee
commit cc80c37bbb
1 changed files with 1 additions and 2 deletions

View File

@ -14,8 +14,7 @@ TUPLE: global-hashtable
TUPLE: global-box value ;
: (box-at) ( key globals -- box )
boxes>> 2dup at
[ 2nip ] [ [ f global-box boa ] 2dip [ set-at ] 2curry keep ] if* ; foldable
boxes>> [ drop f global-box boa ] cache ; foldable
: box-at ( key globals -- box )
(box-at) { global-box } declare ; inline