GNU bug report logs -
#64292
30.0.50; setf strange when lexical-binding is nil
Previous Next
Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>
Date: Mon, 26 Jun 2023 01:46:02 UTC
Severity: normal
Merged with 64315
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Mattias EngdegÄrd [2023-06-27 15:21:08] wrote:
>> (setq lexical-binding nil)
>> (require 'nnheader)
>> (macroexpand '(setf (mail-header-date header) date))
>> => (let* ((v #'(lambda (cl-x) (progn (progn (aref cl-x 3)))))
>> (v header))
>> (\(setf\ funcall\) date v v))
>>
>> This looks broken, though it gets normal if lexical-binding is t.
>> Because of this, an old ELisp module doesn't work. In addition,
>> the funny portion is replaced with
>> \(setf\ internal--with-suppressed-warnings\)...
>> if the code is byte-compiled.
>
> This is effectively an encrypted "you should use lexical-binding:t" error message.
> Stefan, should we just bypass the suppression here, or the entire `cl--slet`
> business, in dynbound mode?
Can someone confirm that the patch below reverts the regression?
Stefan
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index aadb498609a..eed7199fcc2 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -247,9 +247,10 @@ cl--slet
"Like `cl--slet*' but for \"parallel let\"."
(let ((dyns nil)) ;Vars declared as dynbound among the bindings?
;; `seq-some' lead to bootstrap problems.
- (dolist (binding bindings)
- (when (macroexp--dynamic-variable-p (car binding))
- (push (car binding) dyns)))
+ (when lexical-binding
+ (dolist (binding bindings)
+ (when (macroexp--dynamic-variable-p (car binding))
+ (push (car binding) dyns))))
(cond
(dyns
(let ((form `(funcall (lambda (,@(mapcar #'car bindings))
This bug report was last modified 1 year and 332 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.