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 /parser.c | |
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.
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 4 |
1 files changed, 2 insertions, 2 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); |