From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brandon Irizarry Newsgroups: gmane.emacs.bugs Subject: bug#65344: 28.2; Unable to Edebug cl-flet form which uses argument destructuring Date: Thu, 17 Aug 2023 11:42:06 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000988e010603204121" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23210"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65344@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 17 17:43:43 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qWf9y-0005s4-J6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Aug 2023 17:43:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWf9T-0000Jj-Iy; Thu, 17 Aug 2023 11:43:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWf9L-0000Ic-72 for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2023 11:43:09 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWf9K-0004j2-Tc for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2023 11:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qWf9K-0001d5-5n for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2023 11:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Brandon Irizarry Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Aug 2023 15:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65344 X-GNU-PR-Package: emacs Original-Received: via spool by 65344-submit@debbugs.gnu.org id=B65344.16922869436220 (code B ref 65344); Thu, 17 Aug 2023 15:43:02 +0000 Original-Received: (at 65344) by debbugs.gnu.org; 17 Aug 2023 15:42:23 +0000 Original-Received: from localhost ([127.0.0.1]:45361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWf8h-0001cE-BP for submit@debbugs.gnu.org; Thu, 17 Aug 2023 11:42:23 -0400 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:53500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWf8e-0001c1-VF for 65344@debbugs.gnu.org; Thu, 17 Aug 2023 11:42:22 -0400 Original-Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2bb9a063f26so27951511fa.2 for <65344@debbugs.gnu.org>; Thu, 17 Aug 2023 08:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692286935; x=1692891735; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=O7xiqEKPW7YLM9Swcl5xaQrys5ypagBI+Evg4GUH2PM=; b=rT61UQdDIAMSmLOHyMJv2PxKo0rt7gu9dwAZYRKtLbcJ2/qPnpWq7OF2Q+vaa3glZQ 0/r2b4Daof0cZF5E3mFRmvdgANH4cPv8bTzXnIUYe9KXhzklmA5Tyc4vLRESr933Zrip jOALN4OKJJDLPzk7UV2EqaecJlVjxFcf2DO5oAftq+YdBgpFg/Ga1h4w4xx+5KNJDuaH 7B4BJCeyhel0snDoDHUOpU7ngxRBm1kMsDW7Y63QbFMq72Ffrh0pqlnhmMgO5V8u6169 +G9KYlXmEsAWraKyduJ3fXGuf3iq3ZbjUrtHYuWXP6LTErM/tNX6VGAcCwRf8kuzoqkN rD2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692286935; x=1692891735; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O7xiqEKPW7YLM9Swcl5xaQrys5ypagBI+Evg4GUH2PM=; b=IJHEr9dOZHh2CBONOr8X+qXwZg2zjIWdQaBb65YuueIQN6F7oroKJSW3oQk2GYbDEp KyO/GAAbXsKFKm9EGpmvcdogKOGSYdVS0/7/95TnARW/n+fmDcWI5W52BR4xuV2qq5Qw YT8d/lr6WpfQN63qTESN8IE55WbrTiBV1RhuzzbhxwNGopyRN6O1MGdL4yQQGc4jT1Kw B4Of5BtzLhmpN+r/YHPpn++71u83+sx9AaKyYXlDhiVIl1DGOSDf1lviHgiPC9JOoRs/ WbVqSPE98njgu2Pat5gRdGTyGpa352oyg++9D99psJn3yv2vMH9lDI2M8e8a2auMrK/U 95Fw== X-Gm-Message-State: AOJu0YwZPFQQ8GqdEMfrmmAUBcQe0lr8kgCHyJfAUin0F9a6g0Gqljmt IunwutIxQJu3676+5CfHkjsPl1YiayilYol/Lyc= X-Google-Smtp-Source: AGHT+IHXD76sf0pOWZ3Qzr9bCsvUaLi0DTEp65iGyTXh0qhujVMbNxBbWKereJjN9/ZD77Pk/dcykAMUxwTfQwCQtZ4= X-Received: by 2002:a2e:9b0d:0:b0:2b9:aa4d:3728 with SMTP id u13-20020a2e9b0d000000b002b9aa4d3728mr4410813lji.29.1692286934616; Thu, 17 Aug 2023 08:42:14 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267673 Archived-At: --000000000000988e010603204121 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Destructured lambda-lists appear to be an Elisp extension to Common Lisp's argument notation, and the Emacs docs do mention them (though not in the Elisp manual; rather, it's in the CL-Lib manual). They even mention your point about such a lambda-list not being valid Common Lisp. >From the CL-Lib manual, 4.3.2 (Function Bindings): Functions defined by =E2=80=98cl-flet=E2=80=99 may use the full Common= Lisp argument notation supported by =E2=80=98cl-defun=E2=80=99; also, the f= unction body is enclosed in an implicit block as if by =E2=80=98cl-defun=E2=80=99. = *Note Program Structure::. Following the reference to Chapter 2, and heading into 2.1 (Argument Lists): Argument lists support =E2=80=9Cdestructuring=E2=80=9D. In Common Lisp, destructuring is only allowed with =E2=80=98defmacro=E2=80=99; this package= allows it with =E2=80=98cl-defun=E2=80=99 and other argument lists as well. That is, while 'defun' doesn't support this, 'cl-defun' (and, by extension, 'cl-flet') does. - Brandon On Thu, Aug 17, 2023 at 1:29=E2=80=AFAM Gerd M=C3=B6llmann wrote: > > (cl-flet ((fn ((min max)) > > (message "%d %d" min max))) > > (fn '(2 3))) > > > > The cl-flet form evaluates fine (e.g. with C-x C-e or C-M-x), which > > leads me to conclude that this construct is legal. > > I think this lambda-list is invalid. It certainly is invalid in CL, and > I can't find any extension mentioned in the Emacs docs. > > Why this doesn't signal an error at evaluation time, I don't know. If > you try this with defun, you get an error. > --000000000000988e010603204121 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Destructured lambda-lists appear to be an Elisp exten= sion to Common Lisp's argument notation,
and the Emacs docs d= o mention them (though not in the Elisp manual; rather, it's in the CL-= Lib manual).
They even mention your point about such a lambda-lis= t not being valid Common Lisp.

From the CL-Lib= manual, 4.3.2 (Function Bindings):

=C2=A0 =C2=A0= =C2=A0 Functions defined by =E2=80=98cl-flet=E2=80=99 may use the full Comm= on Lisp
=C2=A0 =C2=A0 =C2=A0argument notation supported by =E2=80=98cl-d= efun=E2=80=99; also, the function body
=C2=A0 =C2=A0 =C2=A0is enclosed i= n an implicit block as if by =E2=80=98cl-defun=E2=80=99. =C2=A0*Note
=C2= =A0 =C2=A0 =C2=A0Program Structure::.

Following th= e reference to Chapter 2, and heading into 2.1 (Argument Lists):
=

=C2=A0=C2=A0 Argument lists support =E2=80=9Cdestructur= ing=E2=80=9D.=C2=A0 In Common Lisp,
destructuring is only allowed with = =E2=80=98defmacro=E2=80=99; this package allows it
with =E2=80=98cl-defu= n=E2=80=99 and other argument lists as well.

= That is, while 'defun' doesn't support this, 'cl-defun'= (and, by extension, 'cl-flet') does.

- Br= andon

--000000000000988e010603204121--