Paste: Teapot
Author: | littledan |
Mode: | factor |
Date: | Wed, 11 Mar 2009 00:53:41 |
Plain Text |
USING: stack-checker.transforms kernel fry words call
stack-checker continuations parser ;
IN: teapot
: infer? ( word quot -- ? )
[ [ "declared-effect" word-prop ] [ infer ] bi* = ]
[ 3drop f ] recover ;
: call-transform ( word quot -- )
over "declared-effect" word-prop
'[ _ _ call-effect ] 0 define-transform ;
: define-teapot ( word definition -- )
[ define ] [ 2dup infer? [ 2drop ] [ call-transform ] if ] 2bi ;
: TEAPOT: (:) define-teapot ; parsing
New Annotation