From 950e3c765e30648de34cfc4f65fffdce06f0727f Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 1 Apr 2014 21:50:24 -0500 Subject: PS: add stepA_more. Sync other steps. In particular, self reference in function definition and putting readline into _readline function. --- ps/step0_repl.ps | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'ps/step0_repl.ps') diff --git a/ps/step0_repl.ps b/ps/step0_repl.ps index 9dbf107..046e5a1 100644 --- a/ps/step0_repl.ps +++ b/ps/step0_repl.ps @@ -1,4 +1,6 @@ % read +/_readline { print flush (%stdin) (r) file 99 string readline } def + /READ { % just "return" the input string /str exch def @@ -26,17 +28,10 @@ % repl /REP { READ (stub env) EVAL PRINT } def -/stdin (%stdin) (r) file def - { % loop - (user> ) print flush - - stdin 99 string readline - + (user> ) _readline not { exit } if % exit if EOF - %(\ngot line: ) print dup print (\n) print flush - REP print (\n) print } bind loop -- cgit v1.2.3