]> gitweb.factorcode.org Git - factor.git/blob - extra/smalltalk/listener/listener.factor
d5a191a19737a7be8729486a622261430c524535
[factor.git] / extra / smalltalk / listener / listener.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel prettyprint io io.styles colors compiler.units
4 fry debugger sequences locals.rewrite smalltalk.ast
5 smalltalk.eval smalltalk.printer smalltalk.listener splitting ;
6 IN: smalltalk.listener
7
8 : eval-interactively ( string -- )
9     '[
10         _ eval-smalltalk
11         dup nil? [ drop ] [ "Result: " write smalltalk>string print ] if
12     ] try ;
13
14 : smalltalk-listener ( -- )
15     "Smalltalk>" { { background COLOR: light-blue } } format bl flush readln
16     [ eval-interactively smalltalk-listener ] when* ;
17
18 MAIN: smalltalk-listener