From 0a287cb33f5bf6fe48dd08912dec96550205bacd Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 30 Nov 2011 14:32:25 -0800 Subject: [PATCH] combinators.smart: Use an identity memoize on inputs/outputs word to speed up the non-optimizing compiler --- basis/combinators/smart/smart.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/combinators/smart/smart.factor b/basis/combinators/smart/smart.factor index 9742ca72a2..4311252c22 100644 --- a/basis/combinators/smart/smart.factor +++ b/basis/combinators/smart/smart.factor @@ -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