GNU bug report logs - #47552
27.1; cl-defstruct field names matching read-only variables -> bad code

Previous Next

Package: emacs;

Reported by: Matt Armstrong <matt <at> rfc20.org>

Date: Thu, 1 Apr 2021 18:39:01 UTC

Severity: normal

Found in versions 27.1, 28.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #39 received at 47552-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Matt Armstrong <matt <at> rfc20.org>, 47552-done <at> debbugs.gnu.org
Subject: Re: bug#47552: 27.1; cl-defstruct field names matching read-only
 variables -> bad code
Date: Fri, 23 Jun 2023 11:37:53 -0400
>     (defmacro slet* (bindings &rest body)
>       (named-let expand ((bindings bindings))
>         (pcase-exhaustive bindings
>           ('() (macroexp-progn body))
>           (`((,var ,exp) . ,bindings)
>            (let ((rest (expand bindings)))
>      	     (if (macroexp--dynamic-variable-p var)
>      	         `(funcall (identity (lambda (,var) ,rest)) ,exp)
>      	       (macroexp-let* `((,var ,exp)) rest)))))))

Not sure we want to expose that to the language, so I turned it into
a function in `cl-macs.el` for use by `cl-defun/defmacro/defsubst/...`
and pushed it to `master`.

I believe this fixes the bug.


        Stefan





This bug report was last modified 2 years and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.