diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-17 07:15:44 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-17 07:15:44 -0800 |
commit | af791d39068b7cd231497f955c0a314a31ee8881 (patch) | |
tree | 2134a7c919a06bc5b71844e05ac547df6b40d41d /txr.1 | |
parent | 0c5016a7f39a6a70018949da90f3b9737bf945de (diff) | |
download | txr-af791d39068b7cd231497f955c0a314a31ee8881.tar.gz txr-af791d39068b7cd231497f955c0a314a31ee8881.tar.bz2 txr-af791d39068b7cd231497f955c0a314a31ee8881.zip |
* eval.c (op_defvar): Fix the semantics to be similar to Common Lisp:
no effect if the variable already exists.
* txr.1: Documented defvar and lisp-parse.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -5576,6 +5576,29 @@ table, depending on the type of obj. .SH BINDING AND ITERATION +.SS Operator defvar + +.TP +Syntax: + + (defvar <sym> <value>) + +.TP +Description: + +The defvar operator binds a variable in the top-level environment. + +If the variable named <sym> already exists in the top-level environment, the +form has no effect; the <value> form is not evaluated, and the value of the +variable is unchanged. + +If the variable does not exist, then it is introduced, with a value given by +evaluating the <value> form. The <value> form is evaluated in the environment +in which the defvar form occurs, not necessarily in the top-level environment. + +The symbols t and nil may not be used as variables, and neither +can be keyword symbols: symbols denoted by a leading colon. + .SS Operators let and let* .TP @@ -10378,6 +10401,7 @@ the two operations will interfere with the UTF-8 decoding. These functions return nil when the end of data is reached. Errors are represented as exceptions. + .SS Functions put-string, put-line, put-char and put-byte .TP @@ -10488,6 +10512,27 @@ the stream-real-time-p function above), and also for setting the priority at which messages are reported to syslog by the *stdlog* stream (see *stdlog* in the UNIX SYSLOG section). +.SS Function lisp-parse + +.TP +Syntax: + + (lisp-parse <source> : <error-stream>) + +.TP +Description: + +The lisp-parse function converts text denoting TXR Lisp structure, into the +corresponding data structure. The <source> argument may be either a character +string, or a stream. The source must provide the syntax of one complete Lisp +object, without any stray tokens after that object. + +The optional <error-stream> argument can be used to specify a stream to which +parse errors diagnostics are sent. If absent, the diagnostics are suppressed. + +If there are parse errors, the function returns nil; otherwise, it returns the +parsed data structure. + .SH FILESYSTEM ACCESS .SS Function stat |