summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-14 06:46:45 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-14 06:46:45 -0800
commit4477112731119ebc28d5e4a9dce858d8d008af36 (patch)
tree7ac7093b4b934dc4304f7f3984aebbea542506d8 /txr.1
parent014c61e860fce07cceee60efecd949a17e53f2ae (diff)
downloadtxr-4477112731119ebc28d5e4a9dce858d8d008af36.tar.gz
txr-4477112731119ebc28d5e4a9dce858d8d008af36.tar.bz2
txr-4477112731119ebc28d5e4a9dce858d8d008af36.zip
symdiff: new function.
* eval.c (eval_init): Register symdiff intrinsic. * lib.c (symdiff): New function. * lib.h (us_car_p, us_cdr_p): New inline functions. (symdiff): Declared. * txr.1: Documented, also fixing issues not related to symdiff doc.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.132
1 files changed, 23 insertions, 9 deletions
diff --git a/txr.1 b/txr.1
index 396019b1..1799bfba 100644
--- a/txr.1
+++ b/txr.1
@@ -28702,31 +28702,32 @@ the leftmost one is reported. See the notes under
.code pos-max
regarding duplicate maxima.
-.coNP Functions @, uni @ isec and @ diff
+.coNP Functions @, uni @, isec @ diff and @ symdiff
.synb
.mets (uni < seq1 < seq2 >> [ testfun <> [ keyfun ]])
.mets (isec < seq1 < seq2 >> [ testfun <> [ keyfun ]])
.mets (diff < seq1 < seq2 >> [ testfun <> [ keyfun ]])
+.mets (symdiff < seq1 < seq2 >> [ testfun <> [ keyfun ]])
.syne
.desc
The functions
-.codn diff ,
-.code isec
+.codn uni ,
+.codn isec ,
+.code diff
and
-.code uni
-treats the sequences
+.code symdiff
+treat the sequences
.meta seq1
and
.meta seq2
as if they were sets.
-They respectively compute the set union, set intersection
-and set difference of
+They, respectively, compute the set union, set intersection,
+set difference and symmetric difference of
.meta seq1
and
.metn seq2 ,
-returning a new sequence: the union sequence,
-intersection sequence and difference sequence.
+returning a new sequence.
The arguments
.meta seq1
@@ -28807,6 +28808,19 @@ If an element occurs at least once in
.metn seq2 ,
then it does not occur in the difference sequence.
+The symmetric difference sequence produced by
+.code symdiff
+contains all of the elements of
+.meta seq1
+which do not occur in
+.meta seq2
+and
+.IR "vice versa" :
+it also contains all of the elements of
+.meta seq2
+which do not occur in
+.metn seq1 .
+
Element equivalence is determined by a combination of
.meta testfun
and