summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-11 22:07:05 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-11 22:07:05 -0700
commit67b7bc2d2aee78a9fefce12ed9fd252fbd7f1474 (patch)
tree57fe54d58e1382f279d529020d323568c0a482f2 /txr.1
parenta349b8cbb6ba961d04a57c477f601800b45950ef (diff)
downloadtxr-67b7bc2d2aee78a9fefce12ed9fd252fbd7f1474.tar.gz
txr-67b7bc2d2aee78a9fefce12ed9fd252fbd7f1474.tar.bz2
txr-67b7bc2d2aee78a9fefce12ed9fd252fbd7f1474.zip
New :read command in repl for direct stdin parse.
* parser.c (read_eval_ret_last): New function. (repl): Use read_eval_ret_last for :read command. * txr.1: Document :read in new section on direct read from the terminal.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.125
1 files changed, 25 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 023a01df..32799345 100644
--- a/txr.1
+++ b/txr.1
@@ -33584,6 +33584,31 @@ is that arrow keys (and other special command keys) are represented, by a
VT100-compatible terminal or terminal emulator, as special sequences of
bytes beginning with ESC (known as "escape sequences").
+.SS* Reading Forms Directly from the Terminal
+
+The listener is currently line oriented. There is, however, support for
+accepting input which may span multiple lines and come in a large
+quantity.
+
+If the
+.code :read
+keyword is entered into the listener, it will temporarily suspend
+interactive editing and allow the \*(TL parser to read
+directly from standard input. The reading stops when an error occurs,
+or EOF is indicated by entering Ctrl-D.
+
+In direct parsing mode, each expression which is read is evaluated, but its
+value is not printed. However, the value of the last form evaluated is returned
+to the interactive listener, which prints the value and accepts it as if
+it as the result value of the
+.code :read
+command.
+
+Note that none of the material read from the terminal is entered into the
+interactive history. Only the
+.code :read
+command which triggers this parsing mode appears in the history.
+
.SH* DEBUGGER
\*(TX has a simple, crude, built-in debugger. The debugger is invoked by adding
the