summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-25 07:28:47 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-25 07:28:47 -0700
commit9bab9ac8f5634964fe106caace56315b33c06f36 (patch)
treed808a2f7c2f2b26de291b84f73e69a8031df0269
parent90bda5c939db3a65a7c9dc1347855b4a1def1f0a (diff)
downloadtxr-9bab9ac8f5634964fe106caace56315b33c06f36.tar.gz
txr-9bab9ac8f5634964fe106caace56315b33c06f36.tar.bz2
txr-9bab9ac8f5634964fe106caace56315b33c06f36.zip
doc: clarify nullify.
* txr.1: Clarify that nullify also just returns its argument if it is not a sequence at all. Clarify that nullify works on objects via the nullify method only.
-rw-r--r--txr.131
1 files changed, 26 insertions, 5 deletions
diff --git a/txr.1 b/txr.1
index 7b640f76..5164cb85 100644
--- a/txr.1
+++ b/txr.1
@@ -31833,7 +31833,7 @@ by using
.coNP Function @ nullify
.synb
-.mets (nullify << sequence )
+.mets (nullify << obj )
.syne
.desc
The
@@ -31841,11 +31841,32 @@ The
function returns
.code nil
if
-.meta sequence
+.meta obj
is an empty sequence.
-Otherwise it returns
-.meta sequence
-itself.
+Otherwise, if
+.meta obj
+is not an empty sequence, or isn't a sequence, then
+.meta obj
+itself is returned.
+
+If
+.meta obj
+is a structure, then
+.meta obj
+is returned if it doesn't support the
+.code nullify
+method, even if it has other methods such as
+.code length
+by which it could be inferred that it represents an empty sequence.
+
+If
+.meta obj
+has a
+.code nullify
+method, then the
+.code nullify
+function invokes that method and returns whatever value
+that method returns.
Note: the
.code nullify