diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-22 04:13:55 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-22 04:13:55 -0800 |
commit | 5eea3de51c979f554ce868d101f6503f982169cc (patch) | |
tree | c1629101c0e974636c1a0d9e8c52fc935e99983f /txr.1 | |
parent | 1e2b6354bea11c067745a456ed372fbaa5245ec2 (diff) | |
download | txr-5eea3de51c979f554ce868d101f6503f982169cc.tar.gz txr-5eea3de51c979f554ce868d101f6503f982169cc.tar.bz2 txr-5eea3de51c979f554ce868d101f6503f982169cc.zip |
* eval.c (del_s): New symbol variable.
(eval_error): nostatic added to suppress a g++ warning.
(dwim_loc): Takes new value as the original unevaluated form so
it can control evaluation. Support for del operator added.
(op_modplace): Bugfixes: new value form was being unconditionally
evaluated and out of order w.r.t. other forms. Now there is
left to right order. The form is evaluated later, since for most
operators it is on the right, with the exception of push.
dwim places can now optionally control the evaluation of newform.
del operator supported in gethash case as a special case.
error case added for del: if it's not handled in gethash or
dwim_loc, it is an error.
(eval_init): del_s initialized, and del operator added to table.
* txr.vim: syntax highlighting for del.
* txr.1: Documented del.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -4875,7 +4875,7 @@ possible to terminate the function and return a value using (return-from <name> A function may call itself by name, allowing for recursion. -.SS Operators inc, dec, set, push, pop and flip +.SS Operators inc, dec, set, push, pop, flip and del .TP Syntax: @@ -4886,6 +4886,7 @@ Syntax: (push <item> <place>) (pop <place>) (flip <place>) + (del <place>) .TP Description: @@ -4938,6 +4939,15 @@ The flip operator toggles a place between true and false. If the place contains a value other than nil, then its value is replaced with nil. If it contains nil, it is replaced with t. +The del operator does not modify the value of a place, but rather deletes the +place itself. Index values and ranges of lists denoted using the dwim operator +indexing notation can be subject to a deletion, as can hash table entries +denoted using dwim or gethash. It is an error to try to delete other kinds of +places such as simple variables. The del operator returns the value of the +place that was deleted. Deleting from a sequence means removing the element or +elements. Deleting a hash place means removing the corresponding entry from the +hash table. + Currently, these forms are recognized as places: <symbol> |