1 ! Copyright (C) 2004, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel io effects namespaces sequences quotations vocabs
4 generic words stack-checker.backend stack-checker.state
5 stack-checker.known-words stack-checker.transforms
6 stack-checker.errors stack-checker.inlining
7 stack-checker.visitor.dummy ;
10 GENERIC: infer ( quot -- effect )
12 M: callable infer ( quot -- effect )
13 [ infer-quot-here ] with-infer drop ;
16 #! Safe to call from inference transforms.
17 infer effect>string print ;
19 : forget-errors ( -- )
21 dup subwords [ f "cannot-infer" set-word-prop ] each
22 f "cannot-infer" set-word-prop
25 : forget-effects ( -- )
28 dup subwords [ f "inferred-effect" set-word-prop ] each
29 f "inferred-effect" set-word-prop