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 #51 received at 47552 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: matt <at> rfc20.org, 47552 <at> debbugs.gnu.org
Subject: Re: bug#47552: 27.1; cl-defstruct field names matching read-only
 variables -> bad code
Date: Sun, 25 Jun 2023 00:03:52 -0400
> One (very small) downside of the code generated now is that it may
> trigger "Lexical argument shadows the dynamic variable" warnings.

Yup.  The current code doesn't offer a way to silence them with
`with-suppressed-warnings`, AFAICT :-(

> 'date' for example is bad as a slot name when "diary" is loaded.

AFAIK, `date` is not globally defined as dynbound by diary, so it should
not be a problem.  More specifically, the `date` variable is treated as
dynbound only inside calendar's own files, but not in code found in
other files.
If you found it to be otherwise, please report it as a 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.