From cc80c37bbb3beb78f08129120e1d104b7d391685 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 14 Aug 2015 19:51:29 -0700 Subject: [PATCH] namespaces: simplify (box-at) using cache. --- core/namespaces/namespaces.factor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/namespaces/namespaces.factor b/core/namespaces/namespaces.factor index 0a4f6e4173..28cbed5afa 100644 --- a/core/namespaces/namespaces.factor +++ b/core/namespaces/namespaces.factor @@ -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