]> gitweb.factorcode.org Git - factor.git/blob - basis/stack-checker/stack-checker.factor
09cdc08b256b8ada7355705a70226a3f83b9dca8
[factor.git] / basis / stack-checker / stack-checker.factor
1 ! Copyright (C) 2004, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel io effects namespaces sequences
4 quotations vocabs vocabs.loader generic words
5 stack-checker.backend stack-checker.state
6 stack-checker.known-words stack-checker.transforms
7 stack-checker.errors stack-checker.inlining
8 stack-checker.visitor.dummy ;
9 IN: stack-checker
10
11 : infer ( quot -- effect )
12     dup callable?
13     [ [ infer-quot-here ] with-infer drop ]
14     [ drop ( -- x ) ] if ;
15
16 : infer. ( quot -- )
17     ! Safe to call from inference transforms.
18     infer effect>string print ;
19
20 M: callable stack-effect infer ;