From unknown Fri Aug 15 03:38:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24913 <24913@debbugs.gnu.org> To: bug#24913 <24913@debbugs.gnu.org> Subject: Status: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists Reply-To: bug#24913 <24913@debbugs.gnu.org> Date: Fri, 15 Aug 2025 10:38:31 +0000 retitle 24913 25.1.50; Emacs accepts undocumented and confusing combination= s of &optional and &rest in argument lists reassign 24913 emacs submitter 24913 Philipp Stephani severity 24913 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 16:18:11 2016 Received: (at submit) by debbugs.gnu.org; 9 Nov 2016 21:18:11 +0000 Received: from localhost ([127.0.0.1]:51328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4aG3-0004uk-2H for submit@debbugs.gnu.org; Wed, 09 Nov 2016 16:18:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4aG1-0004uX-JS for submit@debbugs.gnu.org; Wed, 09 Nov 2016 16:18:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4aFv-0001sd-5q for submit@debbugs.gnu.org; Wed, 09 Nov 2016 16:18:04 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c4aFv-0001sZ-2E for submit@debbugs.gnu.org; Wed, 09 Nov 2016 16:18:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4aFt-0000xT-2S for bug-gnu-emacs@gnu.org; Wed, 09 Nov 2016 16:18:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4aFs-0001rq-4w for bug-gnu-emacs@gnu.org; Wed, 09 Nov 2016 16:18:01 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:36083) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4aFr-0001rL-TN for bug-gnu-emacs@gnu.org; Wed, 09 Nov 2016 16:18:00 -0500 Received: by mail-wm0-x22a.google.com with SMTP id g23so4895103wme.1 for ; Wed, 09 Nov 2016 13:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=tuIxCYCZtv2Nq33EpQb7npzd+byIngV4fLByI4zFUQY=; b=IrOXPTR9bkvvActGmm16n+nFrN9EdhpNnubj2zUpE+lHcaCIne1Aq8uMxzl520BRGP gY4Pf4b/eFAyRO0JM1Fg9DAYZokmigCnVIABFztzluPpV8m3X4qYrQA2i2OqcwpwjUbV le5muBA+so0t/caX4dxv0zb6JYxwJt/RwVxE7LDf+RQvIrzwVd778Q6SXOrY9rqJ8rfn UmqR1SKSy9SZwO6SbOovi+gjrpFWSOcDgQOGMy8K/8zCzlRjsNpGoxlIFh7hYVTrArfU DQ9AFP834OQwSw9v60RDBdjbA3jwEFufNYknrptJh54x/HT5Kewf3+G8RWk3NPKC7DvD n7zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=tuIxCYCZtv2Nq33EpQb7npzd+byIngV4fLByI4zFUQY=; b=QxgRZXH0P1IlfcvgXA70+7d9sHBleR4755K3Imkub3Kt6t5MuTPCv7PGERMQflMKtc Ibc3Mua+Mpgt4ZYo8qNIq+qbUYJ3OqZY/sLt6dG6N5dieO8kpjNpLP+1axoh9B3w9Oj1 qqwhvwGC/0YcbTusJOMEGUTz58AUVO4L8p0gm6t3nq06FyJKF+JfMekH/B+UEXH3/p/Y n1Xm0JM0cUb5sMWeXCh+OakkcatRPT2BLBbjhO0jvIx0pjlz696E3WmBfPt1eQtMowPA 3IXCcAZ5NlGOASgR7pFDqdV6qqp5/lovSrK4QgRb6uTA9JeSI/P1DwfsF1hEbY7HMQrU DNmg== X-Gm-Message-State: ABUngvdr/N1oJ0yhHQxQk9cez7k8vjmYdpbtK8TS5AC+kh0dtedLC1PvejOby3Z8kznv/A== X-Received: by 10.28.14.65 with SMTP id 62mr114655wmo.3.1478726278511; Wed, 09 Nov 2016 13:17:58 -0800 (PST) Received: from a.muc.corp.google.com ([2a00:79e0:15:4:d141:a38c:6374:fc8b]) by smtp.gmail.com with ESMTPSA id d85sm9126559wmd.17.2016.11.09.13.17.57 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 09 Nov 2016 13:17:57 -0800 (PST) From: Philipp Stephani To: bug-gnu-emacs@gnu.org Subject: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists Date: Wed, 09 Nov 2016 22:17:54 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) For example: (funcall (lambda (&optional &rest &rest &optional x) (list x)) 'a) =3D> ((a)) Obviously here the &rest keyword "wins", but I think that's overly confusing. Such an argument list is most likely a programmer mistake, and should signal an error to make the programmer aware of the mistake. In GNU Emacs 25.1.50.13 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2016-11-09 built on localhost Repository revision: eb364fddec1431f459166cebb36f09f6b371dd71 Windowing system distributor 'The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04 LTS Configured using: 'configure --with-modules --enable-checking --enable-check-lisp-object-type 'CFLAGS=3D-ggdb3 -O0'' Configured features: XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 88939 12159) (symbols 48 19888 0) (miscs 40 343 148) (strings 32 14757 5052) (string-bytes 1 440451) (vectors 16 12779) (vector-slots 8 446082 5011) (floats 8 166 60) (intervals 56 209 0) (buffers 976 24) (heap 1024 23753 956)) --=20 Google Germany GmbH Erika-Mann-Stra=C3=9Fe 33 80636 M=C3=BCnchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und l=C3= =B6schen Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do = not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 07:58:57 2016 Received: (at 24913) by debbugs.gnu.org; 10 Nov 2016 12:58:57 +0000 Received: from localhost ([127.0.0.1]:51760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4owT-0003hq-E7 for submit@debbugs.gnu.org; Thu, 10 Nov 2016 07:58:57 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4owS-0003hd-8Y for 24913@debbugs.gnu.org; Thu, 10 Nov 2016 07:58:56 -0500 Received: by mail-wm0-f46.google.com with SMTP id a197so366422680wmd.0 for <24913@debbugs.gnu.org>; Thu, 10 Nov 2016 04:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=cq1Dxdtc8nuw/kFCJ611uA4QBXregfW5YARiejXijvg=; b=oo/buhFCM+Z7U5XmBBrRa7rL52PCrfBjUmNxIEtZkGTdT24J8eD8hZ/18eeHoFig12 kwaNnfv/wcVXQp7BoFUEkGPVFWTdxgkVUVL3CW98boociE4fkuaxYmtSlKWmsbhnLJ4+ srtFzL82W5GfXLAtvgqRo5/Dq/f6ih96wwPmEfJQltfM7wJ2mMoJPy8FmHtgRavPy9vv ewMpq9qCV6E0Vh2temaq805wYI8do4k2Auxhq+bIzJoh/EVGMoN5LZqauuM+VskgBIjH y9bVMRU+lh+AjOLRh3JXKKV/+Tl69YxDFO84IW/A3Wj1yzV6o8sHl5DuAy4y2cycbrhT 4vsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cq1Dxdtc8nuw/kFCJ611uA4QBXregfW5YARiejXijvg=; b=fb3T3FClyU/prJ9Kd7Xoar3D4YNL+C5pmmgSLoNdBxcEhwv9saOCqsNQgXn20fG00F dnp0pWKNx1dLqp0IMo74nxXouwkZ2MERZFD5rXj8y+HN/hUGRcIsIawhDj5rn0z1FyZv y7Th4cdngOUh2PEK7T1k07ipUwGpEm96mkXQf9lq6dOkbqVnbBKw3JNbD+dOkBbuX7U6 jKGbgFj0rZ/1vxL+d8ScxEYYUkJD6l+POv9B5w+V+H/SZ8PCjM4TX73NLfR38x8D6Fwk xvFERJg8swFlYNOEFggHGihMtoQIbprssBJUkP8NAyDCCzFftFsZSaKBf16wVxMxrFj2 LyFA== X-Gm-Message-State: ABUngvdn4LCCPra0yphNEUdl6W26+iwcQH9Ud0wnmiicNQV5CaqBkIDW9A9MHEHF5LuCBT1cyq9VJTpcekyuQA== X-Received: by 10.194.18.196 with SMTP id y4mr4339047wjd.73.1478782730172; Thu, 10 Nov 2016 04:58:50 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Thu, 10 Nov 2016 12:58:39 +0000 Message-ID: Subject: Re: bug#24913: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists To: 24913@debbugs.gnu.org Content-Type: multipart/mixed; boundary=f46d0444ea695522610540f1efcb X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 24913 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --f46d0444ea695522610540f1efcb Content-Type: multipart/alternative; boundary=f46d0444ea6955225c0540f1efc9 --f46d0444ea6955225c0540f1efc9 Content-Type: text/plain; charset=UTF-8 Philipp Stephani schrieb am Mi., 9. Nov. 2016 um 22:19 Uhr: > > For example: > > (funcall (lambda (&optional &rest &rest &optional x) (list x)) 'a) > => ((a)) > > Obviously here the &rest keyword "wins", but I think that's overly > confusing. Such an argument list is most likely a programmer mistake, > and should signal an error to make the programmer aware of the mistake. > > Here's a patch that detects such argument lists. --f46d0444ea6955225c0540f1efc9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Mi., 9. Nov. 2016 um 22:19=C2=A0Uhr:

For example:

(funcall (lambda (&optional &rest &rest &optional x) (list = x)) 'a)
=3D> ((a))

Obviously here the &rest keyword "wins", but I think that'= ;s overly
confusing.=C2=A0 Such an argument list is most likely a programmer mistake,=
and should signal an error to make the programmer aware of the mistake.


Here's a patch that detects such argum= ent lists.=C2=A0
--f46d0444ea6955225c0540f1efc9-- --f46d0444ea695522610540f1efcb Content-Type: text/plain; charset=US-ASCII; name="0001-Prevent-dubious-argument-lists.txt" Content-Disposition: attachment; filename="0001-Prevent-dubious-argument-lists.txt" Content-Transfer-Encoding: base64 Content-ID: <1584e509a67ee7059201> X-Attachment-Id: 1584e509a67ee7059201 RnJvbSAxODU1ODZhMzM3N2UxNjZhNTEyMzQwNzc5OWFiNzc0MWQ0NjI3YzUyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5jb20+CkRh dGU6IFdlZCwgOSBOb3YgMjAxNiAyMzoxMzo1MiArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIFByZXZl bnQgZHViaW91cyBhcmd1bWVudCBsaXN0cwoKU2VlIEJ1ZyMyNDkxMiBhbmQgQnVnIzI0OTEzLgoK KiBzcmMvZXZhbC5jIChmdW5jYWxsX2xhbWJkYSk6IERldGVjdCBtb3JlIGR1YmlvdXMgYXJndW1l bnQgbGlzdHMuCiogbGlzcC9lbWFjcy1saXNwL2J5dGVjb21wLmVsIChieXRlLWNvbXBpbGUtY2hl Y2stbGFtYmRhLWxpc3QpOiBEZXRlY3QKbW9yZSBkdWJpb3VzIGFyZ3VtZW50IGxpc3RzLgoqIHRl c3Qvc3JjL2V2YWwtdGVzdHMuZWwgKGV2YWwtdGVzdHMtLWJ1Z3MtMjQ5MTItYW5kLTI0OTEzKTog QWRkIHVuaXQKdGVzdC4KLS0tCiBsaXNwL2VtYWNzLWxpc3AvYnl0ZWNvbXAuZWwgfCAgNyArKysr Ky0tCiBzcmMvZXZhbC5jICAgICAgICAgICAgICAgICAgfCAxOCArKysrKysrKysrKysrKystLS0K IHRlc3Qvc3JjL2V2YWwtdGVzdHMuZWwgICAgICB8IDE1ICsrKysrKysrKysrKysrKwogMyBmaWxl cyBjaGFuZ2VkLCAzNSBpbnNlcnRpb25zKCspLCA1IGRlbGV0aW9ucygt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5nMzlkNDAyMAoK --f46d0444ea695522610540f1efcb-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 11:57:00 2016 Received: (at 24913) by debbugs.gnu.org; 10 Nov 2016 16:57:01 +0000 Received: from localhost ([127.0.0.1]:52501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4seq-00017x-Mu for submit@debbugs.gnu.org; Thu, 10 Nov 2016 11:57:00 -0500 Received: from aibo.runbox.com ([91.220.196.211]:59260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4sep-00017p-10 for 24913@debbugs.gnu.org; Thu, 10 Nov 2016 11:56:59 -0500 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1c4sen-0007XN-MM; Thu, 10 Nov 2016 17:56:57 +0100 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=rainbow.local) by mailfront11.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1c4sej-0002OU-0m; Thu, 10 Nov 2016 17:56:53 +0100 From: Gemini Lasswell To: Philipp Stephani , 24913@debbugs.gnu.org Subject: Re: bug#24913: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists References: Date: Thu, 10 Nov 2016 08:56:36 -0800 In-Reply-To: (Philipp Stephani's message of "Thu, 10 Nov 2016 12:58:39 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 24913 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) > Philipp Stephani schrieb am Mi., 9. Nov. 2016 um 22:19 Uhr: > > Here's a patch that detects such argument lists. > A more general solution would be to have the byte compiler try to match Edebug specs, and issue a warning or an error if it fails. That would help find errors in the invocations of all macros, not just ones with argument lists. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 04:06:43 2016 Received: (at 24913) by debbugs.gnu.org; 18 Nov 2016 09:06:43 +0000 Received: from localhost ([127.0.0.1]:33085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7f87-0001eD-B6 for submit@debbugs.gnu.org; Fri, 18 Nov 2016 04:06:43 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7f85-0001dz-D6 for 24913@debbugs.gnu.org; Fri, 18 Nov 2016 04:06:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7f7v-0007EM-EC for 24913@debbugs.gnu.org; Fri, 18 Nov 2016 04:06:36 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7f7v-0007EI-B4; Fri, 18 Nov 2016 04:06:31 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2312 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c7f7s-00055d-R2; Fri, 18 Nov 2016 04:06:29 -0500 Date: Fri, 18 Nov 2016 11:06:33 +0200 Message-Id: <831sy9duna.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Thu, 10 Nov 2016 12:58:39 +0000) Subject: Re: bug#24913: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 24913 Cc: 24913@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Philipp Stephani > Date: Thu, 10 Nov 2016 12:58:39 +0000 > > Philipp Stephani schrieb am Mi., 9. Nov. 2016 um 22:19 Uhr: > > For example: > > (funcall (lambda (&optional &rest &rest &optional x) (list x)) 'a) > => ((a)) > > Obviously here the &rest keyword "wins", but I think that's overly > confusing. Such an argument list is most likely a programmer mistake, > and should signal an error to make the programmer aware of the mistake. > > Here's a patch that detects such argument lists. Thanks, please push to master. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 12:37:44 2016 Received: (at 24913-done) by debbugs.gnu.org; 18 Nov 2016 17:37:44 +0000 Received: from localhost ([127.0.0.1]:34171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7n6e-0000wq-1B for submit@debbugs.gnu.org; Fri, 18 Nov 2016 12:37:44 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:34701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7n6c-0000wb-NT for 24913-done@debbugs.gnu.org; Fri, 18 Nov 2016 12:37:43 -0500 Received: by mail-wm0-f46.google.com with SMTP id u144so7550582wmu.1 for <24913-done@debbugs.gnu.org>; Fri, 18 Nov 2016 09:37:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+/a+Vi1jhMrW3YJ31VRBLmqOAN2PTt7ZhRlTHH+8lbU=; b=WhlO4rJEJu86ktA/Cq/L+WJmphuDbKmY90tTrNSS2Wb+77+E1dCN6wl/sLTvdYppfa V1B9DhF8lNgdqYnCspQeM2KyGZTBq5q5ma0Vf5sf661pGlUCH7X3qojrJ3WKNaQA8j79 8jxEGeGKNQ61WamEyvG9HhFrhaekq8AubpKRHzArd0Lbjtrxpvum7XwFJC3bUQLzCPSV BqC6akwR2e63Ep+FeBNmRHAjNXnNc2p72OcvEq68l1/zzv+IfbxFMztxBAWLoU6QHXz3 YEWK7JOL6HxZf3YlCe45v3XTt+rjRDocxXIOBJEM7e/UXsnApTnUEATsxLe/7vfIo6Od Im3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+/a+Vi1jhMrW3YJ31VRBLmqOAN2PTt7ZhRlTHH+8lbU=; b=PI3EulQ9ZQ4G5F/HA90iiKg/iTmYlQiUlvQTiAUgm6EYjhVN7gWb1zF/kmm+Rsh/dS JB96k9RbuIDxACU089kIBTgUYiu07CijzpZCB69MEY4gIsPNML1YSy770SO9zTcWg+xO Ufh8E2RvlcG6MvM7RGURS+A8b25gCOZf+iMA6h7wjpQu8dJBCkRSAE2Pt53l8E1Ef+p+ t3HcCQ5YSuwFydBcWy5bs3EdiAgZws9KdIc/IbPdOLnqeh4jyCthqrG0GgXhKOoz8db9 o31lKTjoaxZ8YQnejgaC7cL1ILxRqlCl1MCDg/Zf2s8QdlkaoUchdeAUPcYZap5vYyJ3 qqOw== X-Gm-Message-State: AKaTC02Cvbw2Mq/pr6gZ31qF/1Bhtx9ZbkQ6/RH88wetLYiQ4CjGW/23gmthci04/QfV9Xhk8DWpaK2BN+L0Hg== X-Received: by 10.28.129.81 with SMTP id c78mr1497438wmd.94.1479490656976; Fri, 18 Nov 2016 09:37:36 -0800 (PST) MIME-Version: 1.0 References: <831sy9duna.fsf@gnu.org> In-Reply-To: <831sy9duna.fsf@gnu.org> From: Philipp Stephani Date: Fri, 18 Nov 2016 17:37:26 +0000 Message-ID: Subject: Re: bug#24913: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists To: Eli Zaretskii Content-Type: multipart/alternative; boundary=001a114242620ec704054196c378 X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 24913-done Cc: 24913-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --001a114242620ec704054196c378 Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am Fr., 18. Nov. 2016 um 10:06 Uhr: > > From: Philipp Stephani > > Date: Thu, 10 Nov 2016 12:58:39 +0000 > > > > Philipp Stephani schrieb am Mi., 9. Nov. 2016 > um 22:19 Uhr: > > > > For example: > > > > (funcall (lambda (&optional &rest &rest &optional x) (list x)) 'a) > > => ((a)) > > > > Obviously here the &rest keyword "wins", but I think that's overly > > confusing. Such an argument list is most likely a programmer mistake, > > and should signal an error to make the programmer aware of the mistake. > > > > Here's a patch that detects such argument lists. > > Thanks, please push to master. > Done. --001a114242620ec704054196c378 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Fr., 18. Nov. 2016 um 10:06=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Thu, 10 Nov 2016 12:58:39 +0000
>
> Philipp Stephani <p.stephani2@gmail.com> schrieb am Mi.,= 9. Nov. 2016 um 22:19 Uhr:
>
>=C2=A0 For example:
>
>=C2=A0 (funcall (lambda (&optional &rest &rest &optiona= l x) (list x)) 'a)
>=C2=A0 =3D> ((a))
>
>=C2=A0 Obviously here the &rest keyword "wins", but I thi= nk that's overly
>=C2=A0 confusing. Such an argument list is most likely a programmer mis= take,
>=C2=A0 and should signal an error to make the programmer aware of the m= istake.
>
> Here's a patch that detects such argument lists.

Thanks, please push to master.
Done.=C2=A0
--001a114242620ec704054196c378-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 19 11:41:05 2016 Received: (at 24913) by debbugs.gnu.org; 19 Nov 2016 16:41:05 +0000 Received: from localhost ([127.0.0.1]:35288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c88hM-0006w8-Qh for submit@debbugs.gnu.org; Sat, 19 Nov 2016 11:41:05 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c88hL-0006vU-Kp for 24913@debbugs.gnu.org; Sat, 19 Nov 2016 11:41:04 -0500 Received: by mail-wm0-f47.google.com with SMTP id a197so82453093wmd.0 for <24913@debbugs.gnu.org>; Sat, 19 Nov 2016 08:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=cxWmk6GfX+VDaUx4NQ/A93wtCy71I6B3LBPoIG3g9u0=; b=hBiIium1R4xOXzmhqc5UZLU6GGcMWTssaA8EzcIlILaEmejHuQShNOLaH3PBv58gWe q4hMGCnnJS75PvKiS7/D+pIgTEHIRZf/FCGJX3K8VMRjF5oxxS6sxriA0ys3ag9hnNTy 4STHcQOeZuTx2tUhWIx3bpsxDrEP+2pceQ3yXQDpDrOjmXWwvbierJp/d6ed3dLq6WGS hKxscWnYXvB6lKKcdhogLwvwydfZx8dcsY6eeMsj7h28RSjIE+bAX5evUQ2o4wVeQFFs I2XQVT+S/cWhHrWYIBi67lDs6h9aHKtDi5xYgjOpV8zeB5MG3tiZwEJNZkeEsNeOBIhE ailQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cxWmk6GfX+VDaUx4NQ/A93wtCy71I6B3LBPoIG3g9u0=; b=WNKBk6YYA24DfDrOKhQQr6mKwYHFSyWspNVrJTYOvRwYiph5DDx2OyLqB7/6wTS15Y TvpUi13oU7gVFiOi3OZlCm+eCNeFYXpvR3r6UTool/02m6HvyW15djPcoIAkNUaGx8PS CK6U6KvazsaGsXyCD4cIpUEUpayyo0T7L4ModzXMN0ZcjFcj7yG0HdPILVv+jpzYwXEa 709guntGQcRxgMyDa34MIkfnHv589PAYdXN2pgSIB20DswPBtTZspwb2xBQgSPRCSGIs UMD3mSTDdvHSl7E2qg3c7S89Ma9jad1/JG/CrI8EmS5pkBpIuLfAY/Kws6bgIG95DCbh SR3A== X-Gm-Message-State: AKaTC02JOfuaKgAX/HEYRzdQNE/Lh2wwQxF+3FIUBV2EZ91iM663F1vTaYV4ZQ2zpMoACtf+3EAF1KxBTVsSrw== X-Received: by 10.28.87.84 with SMTP id l81mr4570474wmb.48.1479573657970; Sat, 19 Nov 2016 08:40:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sat, 19 Nov 2016 16:40:47 +0000 Message-ID: Subject: Re: bug#24913: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists To: Gemini Lasswell , 24913@debbugs.gnu.org Content-Type: multipart/alternative; boundary=001a11444cc44d6ec00541aa16b1 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 24913 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --001a11444cc44d6ec00541aa16b1 Content-Type: text/plain; charset=UTF-8 Gemini Lasswell schrieb am Do., 10. Nov. 2016 um 17:56 Uhr: > > > Philipp Stephani schrieb am Mi., 9. Nov. 2016 > um 22:19 Uhr: > > > > Here's a patch that detects such argument lists. > > > A more general solution would be to have the byte compiler try to match > Edebug specs, and issue a warning or an error if it fails. That would > help find errors in the invocations of all macros, not just ones with > argument lists. > I don't understand how this is related. This is only about function definitions in the evaluator and the byte compiler. I don't see how Edebug could help here. --001a11444cc44d6ec00541aa16b1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Gemini= Lasswell <gazally@runbox.com&= gt; schrieb am Do., 10. Nov. 2016 um 17:56=C2=A0Uhr:

> Philipp Stephani <p.stephani2@gmail.com> schrieb am Mi.,= 9. Nov. 2016 um 22:19 Uhr:
>
> Here's a patch that detects such argument lists.
>
A more general solution would be to have the byte compiler try to match
Edebug specs, and issue a warning or an error if it fails. That would
help find errors in the invocations of all macros, not just ones with
argument lists.

I d= on't understand how this is related. This is only about function defini= tions in the evaluator and the byte compiler. I don't see how Edebug co= uld help here.
--001a11444cc44d6ec00541aa16b1-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 20 01:31:29 2016 Received: (at 24913) by debbugs.gnu.org; 20 Nov 2016 06:31:29 +0000 Received: from localhost ([127.0.0.1]:35521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8Lez-0004Vw-7v for submit@debbugs.gnu.org; Sun, 20 Nov 2016 01:31:29 -0500 Received: from aibo.runbox.com ([91.220.196.211]:52804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8Lex-0004Vl-8N for 24913@debbugs.gnu.org; Sun, 20 Nov 2016 01:31:27 -0500 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1c8Lev-0002aX-QR; Sun, 20 Nov 2016 07:31:25 +0100 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=rainbow.local) by mailfront11.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1c8Leu-0003CP-Cz; Sun, 20 Nov 2016 07:31:24 +0100 From: Gemini Lasswell To: Philipp Stephani Subject: Re: bug#24913: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists References: Date: Sat, 19 Nov 2016 22:31:21 -0800 In-Reply-To: (Philipp Stephani's message of "Sat, 19 Nov 2016 16:40:47 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 24913 Cc: 24913@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) Philipp Stephani writes: > A more general solution would be to have the byte compiler try to match > Edebug specs, and issue a warning or an error if it fails. That would > help find errors in the invocations of all macros, not just ones with > argument lists. > > I don't understand how this is related. This is only about function > definitions in the evaluator and the byte compiler. I don't see how > Edebug could help here. Edebug specs describe the expected syntax for the arguments of a macro, including the macros which define functions, such as lambda, defun, defmacro etc. If Edebug can't match the actual arguments in a macro invocation to the Edebug spec for that macro, it will signal an error. For an example of Edebug catching a misplaced &optional in an argument list, see bug#24762. So part of my suggestion is that since there exists in Emacs a powerful mechanism for checking macro argument lists, it would be better to use it if we want to let programmers know that their macro invocations are incorrect, instead of adding error checking to individual macros on a case by case basis. Another thought going into this suggestion is my observation that it's not difficult to find bugs in Edebug specs in the Emacs sources right now. One cause of that could be the Edebug spec documentation, which could be improved. But I think the primary reason is that a macro with a broken Edebug spec won't cause an error until someone tries to use Edebug or Testcover on an invocation of that macro, which maybe isn't common practice when reviewing changes. But if the byte compiler checked Edebug specs and signaled errors, then at least those errors in Edebug specs which can be found statically would be noticed immediately. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 20 07:41:21 2016 Received: (at 24913) by debbugs.gnu.org; 20 Nov 2016 12:41:21 +0000 Received: from localhost ([127.0.0.1]:35675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8RQu-0007ng-Ol for submit@debbugs.gnu.org; Sun, 20 Nov 2016 07:41:21 -0500 Received: from mail-wj0-f178.google.com ([209.85.210.178]:36508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8RQs-0007nP-NP for 24913@debbugs.gnu.org; Sun, 20 Nov 2016 07:41:19 -0500 Received: by mail-wj0-f178.google.com with SMTP id qp4so15515643wjc.3 for <24913@debbugs.gnu.org>; Sun, 20 Nov 2016 04:41:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=koPQ/bO7vczaz7wA2O/0ioKiMnOXqFwkkPuLtXu7oHk=; b=gcE86JBKZoL8Y33BQenjNKNe2/RJDagzuGcylMplfOYSUxvhMfonm0W7HPpwAyL5yr kIY0iQWaEytqfTtzR9sN0Vc6+44vycksn43SmOQMhSQx4KY35KitLLTGed5WvicBE4ec s3hnCiqcVEus4E20XlyFzSMSOt7h7Z4ce557902fHRVtgP3e8t45/2bWbMDTZuHkWpCY itVzICXMwoNXkKuBXDgk+mSWgfbHcJG9NdPy73M7gNjo8uQfXVpprc3CwoEptdXNa437 bxX2lkVZvnLPZzWelcxblS9xFKK+cDr2hyTD7TaubDglKhe8tynobQXtd5cmzrn/kYQj MwcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=koPQ/bO7vczaz7wA2O/0ioKiMnOXqFwkkPuLtXu7oHk=; b=OVoU1zMzSA/P4MK6MnCLqjn/XpY3d4lXCEQYq4htUu5zoa1eXmjRtVAa+zWB0G3u8l 1EfNabngHbGaj0eeU85X+FmLhkN46LcLC7hXFQSLrADd1anTtTAc6MpkCePIKNKfsZEQ jvaKhqh45kHbvNqqvg+3f+YRJvWc/94S3xi2gqYnyGPk2SMA/ELEL0VTVzDTdjS6sVQG IveY3Fer9PRdoJrMNLTmL2keGaf94wjU0NU7942Ojt+oUMZ5SIl6EHh4mMsWwPSVB4Ou qpTyV/uqBOvrvRCdI1yrYrGxmVjryKicXRYIpBFITm11HtyRv9ZVWQkZThqfUD3AAYHI HasQ== X-Gm-Message-State: AKaTC01fnl0EkZM0xBWLlw46woFP/pp4cIOTQUdy2tdmY1dx0kMKLCuV0yJ6wcyGTS8kyZqRH1sATWLnRCELJw== X-Received: by 10.194.95.35 with SMTP id dh3mr6168943wjb.141.1479645672966; Sun, 20 Nov 2016 04:41:12 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sun, 20 Nov 2016 12:41:02 +0000 Message-ID: Subject: Re: bug#24913: 25.1.50; Emacs accepts undocumented and confusing combinations of &optional and &rest in argument lists To: Gemini Lasswell Content-Type: multipart/alternative; boundary=047d7bb04050bb13030541bada0b X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 24913 Cc: 24913@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --047d7bb04050bb13030541bada0b Content-Type: text/plain; charset=UTF-8 Gemini Lasswell schrieb am So., 20. Nov. 2016 um 07:31 Uhr: > Philipp Stephani writes: > > > A more general solution would be to have the byte compiler try to match > > Edebug specs, and issue a warning or an error if it fails. That would > > help find errors in the invocations of all macros, not just ones with > > argument lists. > > > > I don't understand how this is related. This is only about function > > definitions in the evaluator and the byte compiler. I don't see how > > Edebug could help here. > > Edebug specs describe the expected syntax for the arguments of a macro, > including the macros which define functions, such as lambda, defun, > defmacro etc. If Edebug can't match the actual arguments in a macro > invocation to the Edebug spec for that macro, it will signal an error. > For an example of Edebug catching a misplaced &optional in an argument > list, see bug#24762. > > So part of my suggestion is that since there exists in Emacs a powerful > mechanism for checking macro argument lists, it would be better to use > it if we want to let programmers know that their macro invocations are > incorrect, instead of adding error checking to individual macros on a > case by case basis. > > Another thought going into this suggestion is my observation that it's > not difficult to find bugs in Edebug specs in the Emacs sources right > now. One cause of that could be the Edebug spec documentation, which > could be improved. But I think the primary reason is that a macro with a > broken Edebug spec won't cause an error until someone tries to use > Edebug or Testcover on an invocation of that macro, which maybe isn't > common practice when reviewing changes. But if the byte compiler checked > Edebug specs and signaled errors, then at least those errors in Edebug > specs which can be found statically would be noticed immediately. > Integrating Edebug checks, byte-compiler checks, and evaluator checks sounds like the right thing to do, but also like a huge amount of work that is out of scope for this bug. Please create a new bug if you want that. Note that a generic checker would still need to catch cases such as (funcall (function (lambda (&rest))) ()) that don't involve any macros. --047d7bb04050bb13030541bada0b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Gemini= Lasswell <gazally@runbox.com&= gt; schrieb am So., 20. Nov. 2016 um 07:31=C2=A0Uhr:
Philipp Stephani <p.stephani2@gmail.com> wr= ites:

>=C2=A0 A more general solution would be to have the byte compiler try t= o match
>=C2=A0 Edebug specs, and issue a warning or an error if it fails. That = would
>=C2=A0 help find errors in the invocations of all macros, not just ones= with
>=C2=A0 argument lists.
>
> I don't understand how this is related. This is only about functio= n
> definitions in the evaluator and the byte compiler. I don't see ho= w
> Edebug could help here.

Edebug specs describe the expected syntax for the arguments of a macro,
including the macros which define functions, such as lambda, defun,
defmacro etc. If Edebug can't match the actual arguments in a macro
invocation to the Edebug spec for that macro, it will signal an error.
For an example of Edebug catching a misplaced &optional in an argument<= br class=3D"gmail_msg"> list, see bug#24762.

So part of my suggestion is that since there exists in Emacs a powerful
mechanism for checking macro argument lists, it would be better to use
it if we want to let programmers know that their macro invocations are
incorrect, instead of adding error checking to individual macros on a
case by case basis.

Another thought going into this suggestion is my observation that it's<= br class=3D"gmail_msg"> not difficult to find bugs in Edebug specs in the Emacs sources right
now. One cause of that could be the Edebug spec documentation, which
could be improved. But I think the primary reason is that a macro with a broken Edebug spec won't cause an error until someone tries to use
Edebug or Testcover on an invocation of that macro, which maybe isn't common practice when reviewing changes. But if the byte compiler checked Edebug specs and signaled errors, then at least those errors in Edebug
specs which can be found statically would be noticed immediately.

Integrating Edebug checks, = byte-compiler checks, and evaluator checks sounds like the right thing to d= o, but also like a huge amount of work that is out of scope for this bug. P= lease create a new bug if you want that.
Note that a generic chec= ker would still need to catch cases such as
(funcall (function (l= ambda (&rest))) ())
that don't involve any macros.=C2=A0<= /div>
--047d7bb04050bb13030541bada0b-- From unknown Fri Aug 15 03:38:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 19 Dec 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator