]> gitweb.factorcode.org Git - factor.git/commitdiff
combinators.smart: Use an identity memoize on inputs/outputs word to speed up the...
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 30 Nov 2011 22:32:25 +0000 (14:32 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 30 Nov 2011 22:41:32 +0000 (14:41 -0800)
basis/combinators/smart/smart.factor

index 9742ca72a273be1b593395ab1ce08c13371178cb..4311252c22ab0d74f67c9f1cf6dc23604caffbe1 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors arrays effects fry generalizations kernel
 macros math math.order sequences sequences.generalizations
 stack-checker stack-checker.backend stack-checker.errors
-stack-checker.values stack-checker.visitor words ;
+stack-checker.values stack-checker.visitor words memoize ;
 IN: combinators.smart
 
 GENERIC: infer-known* ( known -- effect )
@@ -13,7 +13,7 @@ GENERIC: infer-known* ( known -- effect )
         (literal) [ infer-literal-quot ] with-infer drop
     ] [ infer-known* ] if ;
 
-: inputs/outputs ( quot -- in out )
+IDENTITY-MEMO: inputs/outputs ( quot -- in out )
     infer [ in>> ] [ out>> ] bi [ length ] bi@ ;
 
 : inputs ( quot -- n ) inputs/outputs drop ; inline