diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-11 20:06:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-11 20:06:19 -0700 |
commit | ce61431bff702afcbd6a2ef52babd859203cccf8 (patch) | |
tree | d154776beece1eacf4100b98f08ab65dcaf2291d | |
parent | d7dded2d92e7e7d02e6f1493dff199fbf9290213 (diff) | |
download | txr-ce61431bff702afcbd6a2ef52babd859203cccf8.tar.gz txr-ce61431bff702afcbd6a2ef52babd859203cccf8.tar.bz2 txr-ce61431bff702afcbd6a2ef52babd859203cccf8.zip |
Quit if input form is :quit not its value.
* parser.c (repl): Subtle difference. Test form's syntax for
equality to :quit, not its value. The REPL should not
terminate if a form happens to calculate :quit as a value.
* txr.1: Updated.
-rw-r--r-- | parser.c | 4 | ||||
-rw-r--r-- | txr.1 | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -569,10 +569,10 @@ val repl(val bindings, val in_stream, val out_stream) val line = string_utf8(line_u8); val form = lisp_parse(line, out_stream, colon_k, lit("line"), prev_counter); - val value = eval_intrinsic(form, repl_env); - if (value == quit_k) { + if (form == quit_k) { done = t; } else { + val value = eval_intrinsic(form, repl_env); reg_varl(var_sym, value); sethash(result_hash, var_counter, value); prinl(value, out_stream); @@ -33267,7 +33267,7 @@ the prompt is repeated without incrementing the number. Pressing Ctrl-D in a completely empty command line terminates the listener. Another way to quit is to enter the .code :quit -keyword symbol. When a command line evaluates to this symbol, +keyword symbol. When the form input into the listener consists of this symbol, the listener will terminate: .cblk |