combinators.smart: Use an identity memoize on inputs/outputs word to speed up the non-optimizing compiler
parent
f0b6494c76
commit
0a287cb33f
|
@ -3,7 +3,7 @@
|
||||||
USING: accessors arrays effects fry generalizations kernel
|
USING: accessors arrays effects fry generalizations kernel
|
||||||
macros math math.order sequences sequences.generalizations
|
macros math math.order sequences sequences.generalizations
|
||||||
stack-checker stack-checker.backend stack-checker.errors
|
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
|
IN: combinators.smart
|
||||||
|
|
||||||
GENERIC: infer-known* ( known -- effect )
|
GENERIC: infer-known* ( known -- effect )
|
||||||
|
@ -13,7 +13,7 @@ GENERIC: infer-known* ( known -- effect )
|
||||||
(literal) [ infer-literal-quot ] with-infer drop
|
(literal) [ infer-literal-quot ] with-infer drop
|
||||||
] [ infer-known* ] if ;
|
] [ infer-known* ] if ;
|
||||||
|
|
||||||
: inputs/outputs ( quot -- in out )
|
IDENTITY-MEMO: inputs/outputs ( quot -- in out )
|
||||||
infer [ in>> ] [ out>> ] bi [ length ] bi@ ;
|
infer [ in>> ] [ out>> ] bi [ length ] bi@ ;
|
||||||
|
|
||||||
: inputs ( quot -- n ) inputs/outputs drop ; inline
|
: inputs ( quot -- n ) inputs/outputs drop ; inline
|
||||||
|
|
Loading…
Reference in New Issue