From: MON KEY <monkey@sandpframing.com>
To: emacs-devel@gnu.org
Subject: Re: moving more cl seq/mapping support into core
Date: Mon, 27 Sep 2010 15:07:01 -0400 [thread overview]
Message-ID: <AANLkTikWcuvR3eNYAtK=41XhzkUK8j+dzC1U+-Qt9rcL@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikU7-2xj-uS87ENkEn=OgKGRM8F8+AP2f360XrX@mail.gmail.com>
On Fri, Sep 24, 2010 at 6:48 PM, MON KEY <monkey@sandpframing.com> wrote:
>
> Are there any others like this that I've missed?
>
Looks like I missed `edmacro-mismatch' .
This is mismatch from cl-seq.el with "mandatory keywords"...
The signatures of the two functions are quite similiar:
(edmacro-mismatch seq1 seq2 start1 end1 start2 end2)
(mismatch seq1 seq2 [keyword value]...)
Note, that the _real_ source level signature of `edmacro-mismatch' is:
(edmacro-mismatch cl-seq1 cl-seq2 cl-start1 cl-end1 cl-start2 cl-end2)
Indeed `edmacro-mismatch's local vars even "borrow" from the cl "namespace" in
that it let binds cl-from-end, cl-test, cl-test-not, cl-key, and cl-from-end.
Curiously (for me anyhow) `edmacro-mismatch's has to let bind over cl-test and
cl-test-not locals b/c like its cl.el counterpart `edmacro-mismatch' even
evaluates `cl-check-match', i.e. it has to go out of its way to nullify the test
symbols.
As such the difference between the two functions is that `edmacro-mismatch'
doesn't evaluate the `cl-parsing-keywords' macro and offers the same basic set
of keywords (lest :test :test-not) they just aren't opaquely lumped into an
&rest as with `mismatch'.
Following is the wordwise diff of the two functions:
***************
*** 1,11 ****
! (defun mismatch (cl-seq1 cl-seq2 &rest cl-keys)
"Compare SEQ1 with SEQ2, return index of first mismatching element.
Return nil if the sequences match. If one sequence is a prefix of the
! other, the return value indicates the end of the shorter sequence.
! \nKeywords supported: :test :test-not :key :start1 :end1 :start2
:end2 :from-end
! \n(fn SEQ1 SEQ2 [KEYWORD VALUE]...)"
! (cl-parsing-keywords (:test :test-not :key :from-end
! (:start1 0) :end1 (:start2 0) :end2) ()
(or cl-end1 (setq cl-end1 (length cl-seq1)))
(or cl-end2 (setq cl-end2 (length cl-seq2)))
(if cl-from-end
--- 1,9 ----
! (defun edmacro-mismatch (cl-seq1 cl-seq2 cl-start1 cl-end1 cl-start2 cl-end2)
"Compare SEQ1 with SEQ2, return index of first mismatching element.
Return nil if the sequences match. If one sequence is a prefix of the
! other, the return value indicates the end of the shorted sequence.
! \n(fn SEQ1 SEQ2 START1 END1 START2 END2)"
! (let (cl-test cl-test-not cl-key cl-from-end)
(or cl-end1 (setq cl-end1 (length cl-seq1)))
(or cl-end2 (setq cl-end2 (length cl-seq2)))
(if cl-from-end
--
/s_P\
next prev parent reply other threads:[~2010-09-27 19:07 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-24 22:48 moving more cl seq/mapping support into core MON KEY
2010-09-25 5:13 ` Leo
2010-09-25 5:58 ` Miles Bader
2010-09-25 14:42 ` Drew Adams
2010-09-25 15:07 ` Leo
2010-09-25 15:23 ` Drew Adams
2010-09-25 15:30 ` Leo
2010-09-25 15:33 ` David Kastrup
2010-09-25 15:55 ` Drew Adams
2010-09-25 15:55 ` Drew Adams
2010-09-25 16:01 ` Leo
2010-10-01 0:33 ` Daniel Colascione
2010-09-25 21:26 ` Miles Bader
2010-09-26 10:37 ` Richard Stallman
2010-09-26 13:13 ` Leo
2010-09-26 19:32 ` Miles Bader
2010-09-27 6:27 ` Richard Stallman
2010-10-01 0:28 ` Daniel Colascione
2010-10-01 3:16 ` Miles Bader
2010-10-01 20:39 ` Daniel Colascione
2010-10-02 7:12 ` David Kastrup
2010-10-03 23:15 ` Stefan Monnier
2010-10-04 17:41 ` Daniel Colascione
2010-10-05 23:32 ` Stefan Monnier
2010-10-01 11:42 ` Richard Stallman
2010-10-01 20:36 ` Daniel Colascione
2010-10-01 11:42 ` Richard Stallman
2010-10-01 20:34 ` Daniel Colascione
2010-10-01 21:12 ` Chong Yidong
2010-09-27 19:07 ` MON KEY [this message]
2010-10-02 5:35 ` MON KEY
2010-10-04 2:03 ` Richard Stallman
2010-10-04 5:51 ` MON KEY
2010-10-06 5:21 ` Richard Stallman
2010-10-09 0:29 ` MON KEY
2010-10-10 5:09 ` Richard Stallman
2010-10-04 17:33 ` Daniel Colascione
2010-10-05 9:55 ` Richard Stallman
2010-10-05 10:20 ` Helmut Eller
2010-10-05 18:27 ` Eli Zaretskii
2010-10-06 23:41 ` Richard Stallman
2010-10-07 15:04 ` Ted Zlatanov
2010-10-07 15:17 ` Karl Fogel
2010-10-09 2:13 ` Richard Stallman
2010-10-05 13:07 ` Ted Zlatanov
2010-10-06 23:41 ` Richard Stallman
2010-10-07 9:20 ` Daniel Colascione
2010-10-08 5:47 ` Richard Stallman
2010-10-05 18:26 ` Eli Zaretskii
2010-10-06 0:29 ` MON KEY
2010-10-08 2:07 ` Christian Ohler
2010-10-08 2:18 ` Miles Bader
2010-10-08 3:15 ` Christian Ohler
2010-10-06 8:04 ` Stephen J. Turnbull
2010-10-06 9:20 ` David Kastrup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTikWcuvR3eNYAtK=41XhzkUK8j+dzC1U+-Qt9rcL@mail.gmail.com' \
--to=monkey@sandpframing.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.