summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-24 10:44:10 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-24 10:44:10 -0800
commit19fb18a343d88621ebab989539a3463b1ffbba7d (patch)
treebde4ced4fea3ab7b347a0176dc9f5a46ace7b49b /txr.1
parent71bd153f6efd3cc3157bb9dbdf55c97b6e0ad2f5 (diff)
downloadtxr-19fb18a343d88621ebab989539a3463b1ffbba7d.tar.gz
txr-19fb18a343d88621ebab989539a3463b1ffbba7d.tar.bz2
txr-19fb18a343d88621ebab989539a3463b1ffbba7d.zip
New memp function for searching a plist.
* eval.c (eval_init): Register memp intrinsic. * lib.c (memp): New function. * lib.h (memp): Declared. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.148
1 files changed, 43 insertions, 5 deletions
diff --git a/txr.1 b/txr.1
index dd7b816e..198cca4b 100644
--- a/txr.1
+++ b/txr.1
@@ -18184,16 +18184,16 @@ function applied to the corresponding
element of the input list.
.SS* Property Lists
-.coNP Function @ prop
-.synb
-.mets (prop < plist << key )
-.syne
-.desc
A property list a flat list of even length consisting of interleaved
pairs of property names (usually symbols) and their values (arbitrary
objects). An example property list is (:a 1 :b "two") which contains
two properties, :a having value 1, and :b having value "two".
+.coNP Function @ prop
+.synb
+.mets (prop < plist << key )
+.syne
+.desc
The
.code prop
function searches property list
@@ -18211,6 +18211,44 @@ found, or due to the property being present with a
.code nil
value.
+The indicators in
+.meta plist
+are compared with
+.meta key
+using
+.code eq
+equality, allowing them to be symbols, characters or
+.code fixnum
+integers.
+
+.coNP Function @ memp
+.synb
+.mets (memp < key << plist )
+.syne
+.desc
+The
+.code memp
+function searches property list
+.meta plist
+for key
+.metn key ,
+using
+.code eq
+equality.
+
+If the key is found, then the entire suffix of
+.meta plist
+beginning with the indicator is returned, such that the first
+element of the returned list is
+.meta key
+and the second element is the property value.
+
+Note the reversed argument convention relative to the
+.code prop
+function, harmonizing with functions in the
+.code member
+family.
+
.SS* List Sorting
Note: these functions operate on lists. The principal sorting function