GNU bug report logs - #56739
29.0.50; `cl-psetq' and `cl-psetf' fail to recognize symbol macros

Previous Next

Package: emacs;

Reported by: Wing Hei Chan <whmunkchan <at> outlook.com>

Date: Sun, 24 Jul 2022 12:34:03 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Full log


Message #8 received at 56739 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Wing Hei Chan <whmunkchan <at> outlook.com>
Cc: 56739 <at> debbugs.gnu.org
Subject: Re: bug#56739: 29.0.50; `cl-psetq' and `cl-psetf' fail to recognize
 symbol macros
Date: Tue, 02 Aug 2022 04:41:38 +0200
Wing Hei Chan <whmunkchan <at> outlook.com> writes:

> The following form produces (2 2) due to the failure of detecting
> dependencies involving symbol macros.
>
> (cl-symbol-macrolet ((c a))
>   (let ((a 1) (b 2))
>     (cl-psetq a b
>               b c)
>     (list a b)))

Dunno how a good fix would look like - but it is easy to follow why this
error happens: `cl-psetf' analyses the expressions (each second
argument) for whether they are "simple" (independent of the variables):

(if (or (not (symbolp (car p))) (cl--expr-depends-p (nth 1 p) vars))
  (setq simple nil))

but the symbol macro is not yet expanded when this is done, and the
expression `c` passes the test - which is wrong.

Maybe that test should just check for symbol macros in addition?

Michael.




This bug report was last modified 1 year and 282 days ago.

Previous Next


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