refactor stack-checker slightly to fix circular dependency
parent
ff2a53e1b8
commit
4892bf1d47
|
@ -157,3 +157,6 @@ M: bad-call summary
|
||||||
current-effect
|
current-effect
|
||||||
stack-visitor get
|
stack-visitor get
|
||||||
] with-scope ; inline
|
] with-scope ; inline
|
||||||
|
|
||||||
|
: (infer) ( quot -- effect )
|
||||||
|
[ infer-quot-here ] with-infer drop ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! (c)2010 Joe Groff bsd license
|
! (c)2010 Joe Groff bsd license
|
||||||
USING: accessors arrays assocs combinators combinators.short-circuit
|
USING: accessors arrays assocs combinators combinators.short-circuit
|
||||||
continuations effects fry kernel locals math namespaces
|
continuations effects fry kernel locals math namespaces
|
||||||
quotations sequences splitting stack-checker
|
quotations sequences splitting
|
||||||
stack-checker.backend
|
stack-checker.backend
|
||||||
stack-checker.errors
|
stack-checker.errors
|
||||||
stack-checker.known-words
|
stack-checker.known-words
|
||||||
|
@ -68,7 +68,7 @@ GENERIC: (infer-known) ( known -- effect )
|
||||||
M: object (infer-known)
|
M: object (infer-known)
|
||||||
current-word get bad-macro-input ;
|
current-word get bad-macro-input ;
|
||||||
M: literal (infer-known)
|
M: literal (infer-known)
|
||||||
value>> dup callable? [ infer ] [ abandon-check ] if ;
|
value>> dup callable? [ (infer) ] [ abandon-check ] if ;
|
||||||
M: composed (infer-known)
|
M: composed (infer-known)
|
||||||
[ quot1>> known (infer-known) ] [ quot2>> known (infer-known) ] bi compose-effects ;
|
[ quot1>> known (infer-known) ] [ quot2>> known (infer-known) ] bi compose-effects ;
|
||||||
M: curried (infer-known)
|
M: curried (infer-known)
|
||||||
|
|
|
@ -11,7 +11,7 @@ IN: stack-checker
|
||||||
GENERIC: infer ( quot -- effect )
|
GENERIC: infer ( quot -- effect )
|
||||||
|
|
||||||
M: callable infer ( quot -- effect )
|
M: callable infer ( quot -- effect )
|
||||||
[ infer-quot-here ] with-infer drop ;
|
(infer) ;
|
||||||
|
|
||||||
: infer. ( quot -- )
|
: infer. ( quot -- )
|
||||||
#! Safe to call from inference transforms.
|
#! Safe to call from inference transforms.
|
||||||
|
|
Loading…
Reference in New Issue