summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-12-12 06:35:12 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-12-12 06:35:12 -0800
commitd05841efc07ad0300dbfe2d3f3d67131434a8e3c (patch)
treeaa0df0614aacf4377ba25b1f3980e0a3f5b78c8b /txr.1
parente48f1416f777022e215a5b79d86512d365cc550c (diff)
downloadtxr-d05841efc07ad0300dbfe2d3f3d67131434a8e3c.tar.gz
txr-d05841efc07ad0300dbfe2d3f3d67131434a8e3c.tar.bz2
txr-d05841efc07ad0300dbfe2d3f3d67131434a8e3c.zip
Adding mismatch function.
* eval.c (eval_init): Register mismatch intrinsic. * lib.c (mismatch): New function. * lib.c (mismatch): Declared. * txr.1: Documented mismatch.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.141
1 files changed, 41 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 549a7da3..78f72bf4 100644
--- a/txr.1
+++ b/txr.1
@@ -24729,6 +24729,47 @@ from
is passed through this one-argument function, and
the resulting value is used in its place.
+.coNP Function @ mismatch
+.synb
+.mets (mismatch < left-seq < right-seq >> [ testfun <> [ keyfun ]])
+.syne
+.desc
+The
+.code mismatch
+function compares corresponding elements from the sequences
+.meta left-seq
+and
+.metn right-seq ,
+returning the position at which the first mismatch occurs.
+
+If the sequences are of the same length, and their corresponding
+elements are the same, then
+.code nil
+is returned.
+
+If one sequence is shorter than the other, and matches a prefix
+of the other, then the mismatching position returned is one position
+after the last element of the shorter sequence, the same value
+as its length. An empty sequence is a prefix of every sequence.
+
+The
+.meta keyfun
+argument defaults to the
+.code identity
+function. Each element
+from
+.meta sequence
+is passed to
+.meta keyfun
+and the resulting value is used in its place.
+
+After being converted through
+.metn keyfun ,
+items are then compared using
+.metn testfun ,
+which must accept two arguments, and defaults to
+.codn equal .
+
.coNP Function @ where
.synb
.mets (where < function << object )