From 9bab9ac8f5634964fe106caace56315b33c06f36 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 25 Jun 2019 07:28:47 -0700 Subject: 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. --- txr.1 | 31 ++++++++++++++++++++++++++----- 1 file 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 -- cgit v1.2.3