]> gitweb.factorcode.org Git - factor.git/blob - extra/smalltalk/listener/listener.factor
factor: trim using lists
[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: colors debugger io io.styles kernel smalltalk.ast
4 smalltalk.eval smalltalk.printer ;
5 IN: smalltalk.listener
6
7 : eval-interactively ( string -- )
8     '[
9         _ eval-smalltalk
10         dup nil? [ drop ] [ "Result: " write smalltalk>string print ] if
11     ] try ;
12
13 : smalltalk-listener ( -- )
14     "Smalltalk>" { { background COLOR: light-blue } } format bl flush readln
15     [ eval-interactively smalltalk-listener ] when* ;
16
17 MAIN: smalltalk-listener