% 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
-
- %(%lineedit) (r) file 99 string readline
- stdin 99 string readline
+/REP { READ (stub env) EVAL PRINT } def
+% 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