combinators.smart: Use an identity memoize on inputs/outputs word to speed up the non-optimizing compiler

db4
Doug Coleman 2011-11-30 14:32:25 -08:00
parent f0b6494c76
commit 0a287cb33f
1 changed files with 2 additions and 2 deletions

View 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