factor/core/inference/inference.factor

29 lines
721 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
! Copyright (C) 2004, 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
IN: inference
USING: inference.backend inference.dataflow
inference.known-words inference.stack inference.transforms
inference.errors sequences prettyprint io effects kernel
namespaces quotations ;
GENERIC: infer ( quot -- effect )
M: callable infer ( quot -- effect )
[ f infer-quot ] with-infer drop ;
2007-09-20 18:09:08 -04:00
: infer. ( quot -- )
infer effect>string print ;
GENERIC: dataflow ( quot -- dataflow )
2007-09-20 18:09:08 -04:00
M: callable dataflow
[ f infer-quot ] with-infer nip ;
2007-09-20 18:09:08 -04:00
GENERIC# dataflow-with 1 ( quot stack -- dataflow )
M: callable dataflow-with
[
V{ } like meta-d set
f infer-quot
] with-infer nip ;