diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-12 14:56:05 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-03-12 14:56:05 -0700 |
commit | df45e73d23d6871ce0ca415e009bf1bd2a520804 (patch) | |
tree | d57e33be9dad2ee6f3ef598f49c5d093ae0c6f82 /txr.1 | |
parent | 6b7c80ff724f4f8baec2fc0984c6178f75fd9bcd (diff) | |
download | txr-df45e73d23d6871ce0ca415e009bf1bd2a520804.tar.gz txr-df45e73d23d6871ce0ca415e009bf1bd2a520804.tar.bz2 txr-df45e73d23d6871ce0ca415e009bf1bd2a520804.zip |
New rmismatch function.
* eval.c (eval_init): Register rmismatch intrinsic.
* lib.c (rmismatch): New function.
* lib.h (rmismatch): Declared.
* txr.1: Documented
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -25648,6 +25648,36 @@ as an argument. If a value is returned, then the zero-based index of that element is added to a list. Finally, the list is returned. +.coNP Function @ rmismatch +.synb +.mets (rmismatch < left-seq < right-seq >> [ testfun <> [ keyfun ]]) +.syne +.desc +Similarly to +.codn mismatch , +the +.code rmismatch +function compares corresponding elements from the sequences +.meta left-seq +and +.metn right-seq , +returning the position at which the first mismatch occurs. +All of the arguments have the same semantics as that of +.codn mismatch . + +Unlike +.codn mismatch , +.code rmismatch +compares the sequences right-to-left, finding the suffix +which they have in common, rather than prefix. + +If the sequences match, then +.code nil +is returned. Otherwise, a negative index is returned giving the +mismatching position, regarded from the end. If the sequences +match only in the rightmost element, then -1 is returned. If they +match in two elements then -2 and so forth. + .coNP Function @ select .synb .mets (select < object >> { index-list <> | function }) |