bbc-basic: Start of step 9: add 'try*' form and 'throw'.
[jackhill/mal.git] / ps / step0_repl.ps
index 9dbf107..b7c2f17 100644 (file)
@@ -1,4 +1,6 @@
 % read
+/_readline { print flush (%stdin) (r) file 1024 string readline } def
+
 /READ {
     % just "return" the input string
     /str exch def
 % repl
 /REP { READ (stub env) EVAL PRINT } def
 
-/stdin (%stdin) (r) file def 
-
-{ % loop
-    (user> ) print flush
-
-    stdin 99 string readline
-
+% repl loop
+{ %loop
+    (user> ) _readline
     not { exit } if  % exit if EOF
 
-    %(\ngot line: ) print dup print (\n) print flush
-
     REP print (\n) print
 } bind loop