summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-02-23 07:35:36 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-02-23 07:35:36 -0800
commitbf2fbbc765012a3eafa8ef235ab568bde942fdd8 (patch)
tree3824f435eaf66fb102f4b0d06d7df274d97dc768 /txr.1
parent5e72e73394c005dc816b10cdcb5930499e39ad7b (diff)
downloadtxr-bf2fbbc765012a3eafa8ef235ab568bde942fdd8.tar.gz
txr-bf2fbbc765012a3eafa8ef235ab568bde942fdd8.tar.bz2
txr-bf2fbbc765012a3eafa8ef235ab568bde942fdd8.zip
New list-builder method: oust.
* autoload.c (build_set_entries): Add oust symbol. * stdlib/build.tl (list-builder postinit): Call the self argument self instead of bc, for consistency with other methods. (list-builder oust): New method. (list-builder-flets): Add local function oust. * tests/012/seq.tl: New tests. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.153
1 files changed, 52 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index ac7abd73..f1541ceb 100644
--- a/txr.1
+++ b/txr.1
@@ -38037,7 +38037,7 @@ methods extend the list being constructed by a
object by adding lists to it. The
.code pend
method catenates the
-.code list
+.meta list
arguments together as if by the
.code append
function, then appends the resulting list to
@@ -38146,6 +38146,56 @@ object.
-> (1 2 3 4 . 5)
.brev
+.coNP Method @ oust
+.synb
+.mets << list-builder .(oust << list *)
+.syne
+.desc
+The
+.code oust
+method discards the list constructed so far, optionally
+replacing it with new material.
+
+The
+.code oust
+method catenates the
+.meta list
+arguments together as if by the
+.code append
+function. The resulting list, which is empty
+if there are no
+.meta list
+arguments, then replaces the object's
+list constructed so far.
+
+The
+.code oust
+method returns the
+.meta list-builder
+object.
+
+.TP* Examples:
+
+.verb
+ ;; Build the list (3 4) by first building (1 2),
+ ;; then discarding that and adding 3 and 4:
+
+ (let ((lb (build-list)))
+ lb.(add 1 2)
+ lb.(oust)
+ lb.(add 3 4)
+ lb.(get))
+ -> (3 4)
+
+ ;; Build the list (3 4 5 6) by first building (1 2),
+ ;; then replacing with catenation of (3 4) and (5 6):
+ (let ((lb (build-list)))
+ lb.(pend '(1 2))
+ lb.(oust '(3 4) '(5 6))
+ lb.(get))
+ -> (3 4 5 6)
+.brev
+
.coNP Method @ get
.synb
.mets << list-builder .(get)
@@ -38238,6 +38288,7 @@ This lexical environment also provides local functions named
.codn pend* ,
.codn ncon ,
.codn ncon* ,
+.codn oust ,
.codn get ,
.code del
and