factor/core/inference/inference.factor

28 lines
705 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
2007-09-29 19:43:03 -04:00
inference.known-words inference.transforms inference.errors
sequences prettyprint io effects kernel namespaces quotations ;
2007-09-20 18:09:08 -04:00
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 ;