From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry OReilly Newsgroups: gmane.emacs.bugs Subject: bug#14892: [PATCH] Enhance Elisp compare functions (< <= > >=) to take var args Date: Fri, 6 Sep 2013 19:02:14 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0443044e87d8b104e5bf07d9 X-Trace: ger.gmane.org 1378508597 3712 80.91.229.3 (6 Sep 2013 23:03:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Sep 2013 23:03:17 +0000 (UTC) To: 14892@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 07 01:03:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VI53d-0000pk-IT for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Sep 2013 01:03:17 +0200 Original-Received: from localhost ([::1]:40089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI53d-0003v4-4C for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Sep 2013 19:03:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI53U-0003t9-JA for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 19:03:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VI53P-0004OS-N9 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 19:03:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI53P-0004OI-ID for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 19:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VI53O-00031m-3p for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 19:03:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Barry OReilly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Sep 2013 23:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14892-submit@debbugs.gnu.org id=B14892.137850854611588 (code B ref 14892); Fri, 06 Sep 2013 23:03:02 +0000 Original-Received: (at 14892) by debbugs.gnu.org; 6 Sep 2013 23:02:26 +0000 Original-Received: from localhost ([127.0.0.1]:45210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI52m-00030m-9R for submit@debbugs.gnu.org; Fri, 06 Sep 2013 19:02:25 -0400 Original-Received: from mail-wi0-f170.google.com ([209.85.212.170]:36207) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI52i-00030R-PW for 14892@debbugs.gnu.org; Fri, 06 Sep 2013 19:02:22 -0400 Original-Received: by mail-wi0-f170.google.com with SMTP id cb5so1499478wib.3 for <14892@debbugs.gnu.org>; Fri, 06 Sep 2013 16:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hRQ0SXwCk9EwOaZ8JduQ/jVtH2LbRHcD4muwYGJ3Ysk=; b=gWSVbLAH56ZalgdBFS/2r6QBUjjDVVxOGe0SCeQvmLXmPcqZsW7mWOUdtZfbxOgSWn Fieve0ckA4Mv5UUnhV9Nu3IE1rF/CLVLxHBw0DyLRIugE+kuoOejoSh+Kmh+29L0BzN4 Ga07mGhPQTBmiIUBmlCga2M+wRV8Wq5+HOPExHDcObJ1RN4T5mw40BudJoSL+tEJRAyk fAr4bJUgE5zMXaVwCEdXuKqwEStkxT8bbViDsnRpXMqiA4HxVPgNzvEGQvcwwA7W0rb3 q4C7uyQ9oPrcCdG2zhXwtHZZoEwh760FebNixzEeqwJ6XoR1QEYILJLyXznFvwvoHlMQ 1aeA== X-Received: by 10.180.97.38 with SMTP id dx6mr206691wib.26.1378508534697; Fri, 06 Sep 2013 16:02:14 -0700 (PDT) Original-Received: by 10.194.234.234 with HTTP; Fri, 6 Sep 2013 16:02:14 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78078 Archived-At: --f46d0443044e87d8b104e5bf07d9 Content-Type: text/plain; charset=ISO-8859-1 Here is a patch to implement this. The tests in the patch pass. diff --git a/src/bytecode.c b/src/bytecode.c index e0e7b22..b777220 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1364,40 +1364,36 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bgtr): { - Lisp_Object v1; BEFORE_POTENTIAL_GC (); - v1 = POP; - TOP = Fgtr (TOP, v1); + DISCARD (1); + TOP = Fgtr (2, &TOP); AFTER_POTENTIAL_GC (); NEXT; } CASE (Blss): { - Lisp_Object v1; BEFORE_POTENTIAL_GC (); - v1 = POP; - TOP = Flss (TOP, v1); + DISCARD (1); + TOP = Flss (2, &TOP); AFTER_POTENTIAL_GC (); NEXT; } CASE (Bleq): { - Lisp_Object v1; BEFORE_POTENTIAL_GC (); - v1 = POP; - TOP = Fleq (TOP, v1); + DISCARD (1); + TOP = Fleq (2, &TOP); AFTER_POTENTIAL_GC (); NEXT; } CASE (Bgeq): { - Lisp_Object v1; BEFORE_POTENTIAL_GC (); - v1 = POP; - TOP = Fgeq (TOP, v1); + DISCARD (1); + TOP = Fgeq (2, &TOP); AFTER_POTENTIAL_GC (); NEXT; } diff --git a/src/data.c b/src/data.c index 9f4bd1f..cbfb18f 100644 --- a/src/data.c +++ b/src/data.c @@ -2310,41 +2310,53 @@ arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) } } -DEFUN ("=", Feqlsign, Seqlsign, 2, 2, 0, - doc: /* Return t if two args, both numbers or markers, are equal. */) - (register Lisp_Object num1, Lisp_Object num2) +static Lisp_Object +arithcompare_driver (ptrdiff_t nargs, Lisp_Object *args, + enum comparison comparison) { - return arithcompare (num1, num2, equal); + for (ptrdiff_t argnum = 1; argnum < nargs; ++argnum) + { + if (EQ (Qnil, arithcompare (args[argnum-1], args[argnum], comparison))) + return Qnil; + } + return Qt; } -DEFUN ("<", Flss, Slss, 2, 2, 0, - doc: /* Return t if first arg is less than second arg. Both must be numbers or markers. */) - (register Lisp_Object num1, Lisp_Object num2) +DEFUN ("=", Feqlsign, Seqlsign, 1, MANY, 0, + doc: /* Return t if args, all numbers or markers, are equal. */) + (ptrdiff_t nargs, Lisp_Object *args) { - return arithcompare (num1, num2, less); + return arithcompare_driver (nargs, args, equal); } -DEFUN (">", Fgtr, Sgtr, 2, 2, 0, - doc: /* Return t if first arg is greater than second arg. Both must be numbers or markers. */) - (register Lisp_Object num1, Lisp_Object num2) +DEFUN ("<", Flss, Slss, 1, MANY, 0, + doc: /* Return t if each arg is less than the next arg. All must be numbers or markers. */) + (ptrdiff_t nargs, Lisp_Object *args) { - return arithcompare (num1, num2, grtr); + return arithcompare_driver (nargs, args, less); } -DEFUN ("<=", Fleq, Sleq, 2, 2, 0, - doc: /* Return t if first arg is less than or equal to second arg. -Both must be numbers or markers. */) - (register Lisp_Object num1, Lisp_Object num2) +DEFUN (">", Fgtr, Sgtr, 1, MANY, 0, + doc: /* Return t if each arg is greater than the next arg. All must be numbers or markers. */) + (ptrdiff_t nargs, Lisp_Object *args) { - return arithcompare (num1, num2, less_or_equal); + return arithcompare_driver (nargs, args, grtr); } -DEFUN (">=", Fgeq, Sgeq, 2, 2, 0, - doc: /* Return t if first arg is greater than or equal to second arg. -Both must be numbers or markers. */) - (register Lisp_Object num1, Lisp_Object num2) +DEFUN ("<=", Fleq, Sleq, 1, MANY, 0, + doc: /* Return t if each arg is less than or equal to the next arg. +All must be numbers or markers. */) + (ptrdiff_t nargs, Lisp_Object *args) +{ + return arithcompare_driver (nargs, args, less_or_equal); +} + +DEFUN (">=", Fgeq, Sgeq, 1, MANY, 0, + doc: /* Return t if each arg is greater than or equal to the next arg. +All must be numbers or markers. */) + (ptrdiff_t nargs, Lisp_Object *args) { - return arithcompare (num1, num2, grtr_or_equal); + return arithcompare_driver (nargs, args, grtr_or_equal); } DEFUN ("/=", Fneq, Sneq, 2, 2, 0, diff --git a/src/fileio.c b/src/fileio.c index a751a73..6a8ab9b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5121,7 +5121,8 @@ DEFUN ("car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2, 0, doc: /* Return t if (car A) is numerically less than (car B). */) (Lisp_Object a, Lisp_Object b) { - return Flss (Fcar (a), Fcar (b)); + Lisp_Object args[2] = { Fcar (a), Fcar (b), }; + return Flss (2, args); } /* Build the complete list of annotations appropriate for writing out diff --git a/test/automated/data-tests.el b/test/automated/data-tests.el index e69de29..2298fa3 100644 --- a/test/automated/data-tests.el +++ b/test/automated/data-tests.el @@ -0,0 +1,75 @@ +;;; data-tests.el --- tests for src/data.c + +;; Copyright (C) 2013 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; This program is free software: you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see `http://www.gnu.org/licenses/'. + +;;; Commentary: + +;;; Code: + +(ert-deftest data-tests-= () + (should-error (=)) + (should (= 1)) + (should (= 2 2)) + (should (= 9 9 9 9 9 9 9 9 9)) + (should-not (apply #'= '(3 8 3))) + (should-error (= 9 9 'foo)) + ;; Short circuits before getting to bad arg + (should-not (= 9 8 'foo))) + +(ert-deftest data-tests-< () + (should-error (<)) + (should (< 1)) + (should (< 2 3)) + (should (< -6 -1 0 2 3 4 8 9 999)) + (should-not (apply #'< '(3 8 3))) + (should-error (< 9 10 'foo)) + ;; Short circuits before getting to bad arg + (should-not (< 9 8 'foo))) + +(ert-deftest data-tests-> () + (should-error (>)) + (should (> 1)) + (should (> 3 2)) + (should (> 6 1 0 -2 -3 -4 -8 -9 -999)) + (should-not (apply #'> '(3 8 3))) + (should-error (> 9 8 'foo)) + ;; Short circuits before getting to bad arg + (should-not (> 8 9 'foo))) + +(ert-deftest data-tests-<= () + (should-error (<=)) + (should (<= 1)) + (should (<= 2 3)) + (should (<= -6 -1 -1 0 0 0 2 3 4 8 999)) + (should-not (apply #'<= '(3 8 3 3))) + (should-error (<= 9 10 'foo)) + ;; Short circuits before getting to bad arg + (should-not (<= 9 8 'foo))) + +(ert-deftest data-tests->= () + (should-error (>=)) + (should (>= 1)) + (should (>= 3 2)) + (should (>= 666 1 0 0 -2 -3 -3 -3 -4 -8 -8 -9 -999)) + (should-not (apply #'>= '(3 8 3))) + (should-error (>= 9 8 'foo)) + ;; Short circuits before getting to bad arg + (should-not (>= 8 9 'foo))) + +;;; data-tests.el ends here + I didn't do /=. If I implement /= with Fsort, then it won't behave quite like in other Lisps. In SBCL: (/= 1 2 3 'foo) signals error (/= 1 2 1 'foo) evaluates to NIL To not get an error for the latter, I would want to use a hash map or tree map. Are either of these ready-available to Emacs C code? --f46d0443044e87d8b104e5bf07d9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Here is a patch to implement this. The tests in the patch = pass.

diff --git a/src/bytecode.c b/src/bytecode.c
index e0e7b22.= .b777220 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1364= ,40 +1364,36 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Li= sp_Object maxdepth,
=A0
=A0=A0=A0=A0 CASE (Bgtr):
=A0=A0=A0=A0 =A0 {
-=A0=A0=A0 =A0=A0= =A0 Lisp_Object v1;
=A0=A0=A0=A0 =A0=A0=A0 BEFORE_POTENTIAL_GC ();
-= =A0=A0=A0 =A0=A0=A0 v1 =3D POP;
-=A0=A0=A0 =A0=A0=A0 TOP =3D Fgtr (TOP, = v1);
+=A0=A0=A0 =A0=A0=A0 DISCARD (1);
+=A0=A0=A0 =A0=A0=A0 TOP =3D F= gtr (2, &TOP);
=A0=A0=A0=A0 =A0=A0=A0 AFTER_POTENTIAL_GC ();
=A0=A0=A0=A0 =A0=A0=A0 NEX= T;
=A0=A0=A0=A0 =A0 }
=A0
=A0=A0=A0=A0 CASE (Blss):
=A0=A0=A0= =A0 =A0 {
-=A0=A0=A0 =A0=A0=A0 Lisp_Object v1;
=A0=A0=A0=A0 =A0=A0=A0= BEFORE_POTENTIAL_GC ();
-=A0=A0=A0 =A0=A0=A0 v1 =3D POP;
-=A0=A0=A0 = =A0=A0=A0 TOP =3D Flss (TOP, v1);
+=A0=A0=A0 =A0=A0=A0 DISCARD (1);
+=A0=A0=A0 =A0=A0=A0 TOP =3D Flss (2, = &TOP);
=A0=A0=A0=A0 =A0=A0=A0 AFTER_POTENTIAL_GC ();
=A0=A0=A0=A0= =A0=A0=A0 NEXT;
=A0=A0=A0=A0 =A0 }
=A0
=A0=A0=A0=A0 CASE (Bleq):<= br>=A0=A0=A0=A0 =A0 {
-=A0=A0=A0 =A0=A0=A0 Lisp_Object v1;
=A0=A0=A0= =A0 =A0=A0=A0 BEFORE_POTENTIAL_GC ();
-=A0=A0=A0 =A0=A0=A0 v1 =3D POP;
-=A0=A0=A0 =A0=A0=A0 TOP =3D Fleq (TOP,= v1);
+=A0=A0=A0 =A0=A0=A0 DISCARD (1);
+=A0=A0=A0 =A0=A0=A0 TOP =3D = Fleq (2, &TOP);
=A0=A0=A0=A0 =A0=A0=A0 AFTER_POTENTIAL_GC ();
=A0= =A0=A0=A0 =A0=A0=A0 NEXT;
=A0=A0=A0=A0 =A0 }
=A0
=A0=A0=A0=A0 CASE= (Bgeq):
=A0=A0=A0=A0 =A0 {
-=A0=A0=A0 =A0=A0=A0 Lisp_Object v1;
=A0=A0=A0=A0 =A0=A0=A0 BEFORE_POTEN= TIAL_GC ();
-=A0=A0=A0 =A0=A0=A0 v1 =3D POP;
-=A0=A0=A0 =A0=A0=A0 TOP= =3D Fgeq (TOP, v1);
+=A0=A0=A0 =A0=A0=A0 DISCARD (1);
+=A0=A0=A0 =A0= =A0=A0 TOP =3D Fgeq (2, &TOP);
=A0=A0=A0=A0 =A0=A0=A0 AFTER_POTENTIA= L_GC ();
=A0=A0=A0=A0 =A0=A0=A0 NEXT;
=A0=A0=A0=A0 =A0 }
diff --git a/src/data.c b/src/data.c
index 9f4bd1f= ..cbfb18f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2310,41 +23= 10,53 @@ arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison = comparison)
=A0=A0=A0=A0 }
=A0}
=A0
-DEFUN ("=3D", Feqlsign, Seqlsig= n, 2, 2, 0,
-=A0=A0=A0=A0=A0=A0 doc: /* Return t if two args, both numbe= rs or markers, are equal.=A0 */)
-=A0 (register Lisp_Object num1, Lisp_O= bject num2)
+static Lisp_Object
+arithcompare_driver (ptrdiff_t nargs, Lisp_Object *args,
+=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 enum comparison comparison= )
=A0{
-=A0 return arithcompare (num1, num2, equal);
+=A0 for (ptr= diff_t argnum =3D 1; argnum < nargs; ++argnum)
+=A0=A0=A0 {
+=A0=A0=A0=A0=A0 if (EQ (Qnil, arithcompare (args[argnum-1]= , args[argnum], comparison)))
+=A0=A0=A0=A0=A0=A0=A0 return Qnil;
+= =A0=A0=A0 }
+=A0 return Qt;
=A0}
=A0
-DEFUN ("<", = Flss, Slss, 2, 2, 0,
-=A0=A0=A0=A0=A0=A0 doc: /* Return t if first arg i= s less than second arg.=A0 Both must be numbers or markers.=A0 */)
-=A0 (register Lisp_Object num1, Lisp_Object num2)
+DEFUN ("=3D&quo= t;, Feqlsign, Seqlsign, 1, MANY, 0,
+=A0=A0=A0=A0=A0=A0 doc: /* Return t= if args, all numbers or markers, are equal.=A0 */)
+=A0 (ptrdiff_t narg= s, Lisp_Object *args)
=A0{
-=A0 return arithcompare (num1, num2, less);
+=A0 return arithco= mpare_driver (nargs, args, equal);
=A0}
=A0
-DEFUN (">&quo= t;, Fgtr, Sgtr, 2, 2, 0,
-=A0=A0=A0=A0=A0=A0 doc: /* Return t if first a= rg is greater than second arg.=A0 Both must be numbers or markers.=A0 */) -=A0 (register Lisp_Object num1, Lisp_Object num2)
+DEFUN ("<&qu= ot;, Flss, Slss, 1, MANY, 0,
+=A0=A0=A0=A0=A0=A0 doc: /* Return t if eac= h arg is less than the next arg.=A0 All must be numbers or markers.=A0 */)<= br>+=A0 (ptrdiff_t nargs, Lisp_Object *args)
=A0{
-=A0 return arithcompare (num1, num2, grtr);
+=A0 return arithco= mpare_driver (nargs, args, less);
=A0}
=A0
-DEFUN ("<=3D&q= uot;, Fleq, Sleq, 2, 2, 0,
-=A0=A0=A0=A0=A0=A0 doc: /* Return t if first= arg is less than or equal to second arg.
-Both must be numbers or markers.=A0 */)
-=A0 (register Lisp_Object num1= , Lisp_Object num2)
+DEFUN (">", Fgtr, Sgtr, 1, MANY, 0,+=A0=A0=A0=A0=A0=A0 doc: /* Return t if each arg is greater than the next = arg.=A0 All must be numbers or markers.=A0 */)
+=A0 (ptrdiff_t nargs, Lisp_Object *args)
=A0{
-=A0 return arithcompa= re (num1, num2, less_or_equal);
+=A0 return arithcompare_driver (nargs, = args, grtr);
=A0}
=A0
-DEFUN (">=3D", Fgeq, Sgeq, 2, = 2, 0,
-=A0=A0=A0=A0=A0=A0 doc: /* Return t if first arg is greater than = or equal to second arg.
-Both must be numbers or markers.=A0 */)
-=A0 (register Lisp_Object num1= , Lisp_Object num2)
+DEFUN ("<=3D", Fleq, Sleq, 1, MANY, 0,=
+=A0=A0=A0=A0=A0=A0 doc: /* Return t if each arg is less than or equal = to the next arg.
+All must be numbers or markers.=A0 */)
+=A0 (ptrdiff_t nargs, Lisp_Obje= ct *args)
+{
+=A0 return arithcompare_driver (nargs, args, less_or_eq= ual);
+}
+
+DEFUN (">=3D", Fgeq, Sgeq, 1, MANY, 0,+=A0=A0=A0=A0=A0=A0 doc: /* Return t if each arg is greater than or equal = to the next arg.
+All must be numbers or markers.=A0 */)
+=A0 (ptrdiff_t nargs, Lisp_Obje= ct *args)
=A0{
-=A0 return arithcompare (num1, num2, grtr_or_equal);<= br>+=A0 return arithcompare_driver (nargs, args, grtr_or_equal);
=A0}=A0
=A0DEFUN ("/=3D", Fneq, Sneq, 2, 2, 0,
diff --git a/src/fileio.c b/src/fileio.c
index a751a73..6a8ab9b 100644--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5121,7 +5121,8 @@ DEFUN (= "car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2= , 0,
=A0=A0=A0=A0=A0=A0=A0 doc: /* Return t if (car A) is numerically less than = (car B).=A0 */)
=A0=A0 (Lisp_Object a, Lisp_Object b)
=A0{
-=A0 re= turn Flss (Fcar (a), Fcar (b));
+=A0 Lisp_Object args[2] =3D { Fcar (a),= Fcar (b), };
+=A0 return Flss (2, args);
=A0}
=A0
=A0/* Build the complete list of annotations appropriate for= writing out
diff --git a/test/automated/data-tests.el b/test/automated/= data-tests.el
index e69de29..2298fa3 100644
--- a/test/automated/data= -tests.el
+++ b/test/automated/data-tests.el
@@ -0,0 +1,75 @@
+;;; data-tests.e= l --- tests for src/data.c
+
+;; Copyright (C) 2013 Free Software Fou= ndation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; This = program is free software: you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; p= ublished by the Free Software Foundation, either version 3 of the
+;; Li= cense, or (at your option) any later version.
+;;
+;; This program is= distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCH= ANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=A0 See the GNU
+;; Gener= al Public License for more details.
+;;
+;; You should have received = a copy of the GNU General Public License
+;; along with this program.=A0 If not, see `http://www.gnu.org/licenses/'.
+
+;;; Commentary:<= br>+
+;;; Code:
+
+(ert-deftest data-tests-=3D ()
+=A0 (should-= error (=3D))
+=A0 (should (=3D 1))
+=A0 (should (=3D 2 2))
+=A0 (should (=3D 9 9 9= 9 9 9 9 9 9))
+=A0 (should-not (apply #'=3D '(3 8 3)))
+=A0 = (should-error (=3D 9 9 'foo))
+=A0 ;; Short circuits before getting = to bad arg
+=A0 (should-not (=3D 9 8 'foo)))
+
+(ert-deftest data-tests-< ()
+=A0 (should-error (<))
+=A0= (should (< 1))
+=A0 (should (< 2 3))
+=A0 (should (< -6 -1 = 0 2 3 4 8 9 999))
+=A0 (should-not (apply #'< '(3 8 3)))
+= =A0 (should-error (< 9 10 'foo))
+=A0 ;; Short circuits before getting to bad arg
+=A0 (should-not (< = 9 8 'foo)))
+
+(ert-deftest data-tests-> ()
+=A0 (should-er= ror (>))
+=A0 (should (> 1))
+=A0 (should (> 3 2))
+=A0 (= should (> 6 1 0 -2 -3 -4 -8 -9 -999))
+=A0 (should-not (apply #'> '(3 8 3)))
+=A0 (should-error (&g= t; 9 8 'foo))
+=A0 ;; Short circuits before getting to bad arg
+= =A0 (should-not (> 8 9 'foo)))
+
+(ert-deftest data-tests-<= =3D ()
+=A0 (should-error (<=3D))
+=A0 (should (<=3D 1))
+=A0 (should = (<=3D 2 3))
+=A0 (should (<=3D -6 -1 -1 0 0 0 2 3 4 8 999))
+= =A0 (should-not (apply #'<=3D '(3 8 3 3)))
+=A0 (should-error= (<=3D 9 10 'foo))
+=A0 ;; Short circuits before getting to bad arg
+=A0 (should-not (<= =3D 9 8 'foo)))
+
+(ert-deftest data-tests->=3D ()
+=A0 (sh= ould-error (>=3D))
+=A0 (should (>=3D 1))
+=A0 (should (>=3D= 3 2))
+=A0 (should (>=3D 666 1 0 0 -2 -3 -3 -3 -4 -8 -8 -9 -999)) +=A0 (should-not (apply #'>=3D '(3 8 3)))
+=A0 (should-error = (>=3D 9 8 'foo))
+=A0 ;; Short circuits before getting to bad arg=
+=A0 (should-not (>=3D 8 9 'foo)))
+
+;;; data-tests.el en= ds here
+

I didn't do /=3D. If I implement /=3D with Fsort, then it won&= #39;t behave
quite like in other Lisps.

In SBCL:
=A0 (/=3D 1 2= 3 'foo) signals error
=A0 (/=3D 1 2 1 'foo) evaluates to NIL
To not get an error for the latter, I would want to use a hash map or<= br> tree map. Are either of these ready-available to Emacs C code?

--f46d0443044e87d8b104e5bf07d9--