From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: Re: moving more cl seq/mapping support into core Date: Mon, 27 Sep 2010 15:07:01 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1285615138 19830 80.91.229.12 (27 Sep 2010 19:18:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Sep 2010 19:18:58 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 27 21:18:57 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P0JDx-0007dm-ES for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 21:18:53 +0200 Original-Received: from localhost ([127.0.0.1]:37726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0J2d-0002bp-5V for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 15:07:11 -0400 Original-Received: from [140.186.70.92] (port=51968 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0J2X-0002bY-7I for emacs-devel@gnu.org; Mon, 27 Sep 2010 15:07:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0J2V-0001QZ-OD for emacs-devel@gnu.org; Mon, 27 Sep 2010 15:07:04 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:35084) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0J2V-0001QM-Hj for emacs-devel@gnu.org; Mon, 27 Sep 2010 15:07:03 -0400 Original-Received: by wwb24 with SMTP id 24so5752354wwb.30 for ; Mon, 27 Sep 2010 12:07:01 -0700 (PDT) Original-Received: by 10.216.157.81 with SMTP id n59mr6623324wek.84.1285614421328; Mon, 27 Sep 2010 12:07:01 -0700 (PDT) Original-Received: by 10.216.67.195 with HTTP; Mon, 27 Sep 2010 12:07:01 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: aBHKhmDqh8Cixwtb9W7Ll4JjZ4I X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131015 Archived-At: On Fri, Sep 24, 2010 at 6:48 PM, MON KEY 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\