]> gitweb.factorcode.org Git - factor.git/blob - basis/eval/eval.factor
Merge branch 'emacs' of http://git.hacks-galore.org/jao/factor
[factor.git] / basis / eval / eval.factor
1 ! Copyright (C) 2008, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: splitting parser compiler.units kernel namespaces
4 debugger io.streams.string fry ;
5 IN: eval
6
7 : parse-string ( str -- )
8     [ string-lines parse-lines ] with-compilation-unit ;
9
10 : (eval) ( str -- )
11     parse-string call ;
12
13 : eval ( str -- )
14     [ (eval) ] with-file-vocabs ;
15
16 : (eval>string) ( str -- output )
17     [
18         "quiet" on
19         parser-notes off
20         '[ _ (eval) ] try
21     ] with-string-writer ;
22
23 : eval>string ( str -- output )
24     [ (eval>string) ] with-file-vocabs ;