]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/smalltalk/listener/listener.factor
factor: trim using lists
[factor.git] / extra / smalltalk / listener / listener.factor
index bef4adc19652cc9a78f45829bf115789078586c4..afbe30fb3fc7567c2853fa696ca560da8aca1142 100644 (file)
@@ -1,18 +1,17 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel prettyprint io io.styles colors.constants compiler.units
-fry debugger sequences locals.rewrite.closures smalltalk.ast
-smalltalk.parser smalltalk.compiler smalltalk.printer ;
+USING: colors debugger io io.styles kernel smalltalk.ast
+smalltalk.eval smalltalk.printer ;
 IN: smalltalk.listener
 
-: eval-smalltalk ( string -- )
-    [
-        parse-smalltalk compile-smalltalk
-    ] with-compilation-unit call( -- result )
-    dup nil? [ drop ] [ "Result: " write smalltalk>string print ] if ;
+: eval-interactively ( string -- )
+    '[
+        _ eval-smalltalk
+        dup nil? [ drop ] [ "Result: " write smalltalk>string print ] if
+    ] try ;
 
 : smalltalk-listener ( -- )
     "Smalltalk>" { { background COLOR: light-blue } } format bl flush readln
-    [ '[ _ eval-smalltalk ] try smalltalk-listener ] when* ;
+    [ eval-interactively smalltalk-listener ] when* ;
 
-MAIN: smalltalk-listener
\ No newline at end of file
+MAIN: smalltalk-listener