GNU bug report logs - #46834
28.0.50; byte-compiling the standard counter closure fails

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Sun, 28 Feb 2021 18:08:02 UTC

Severity: normal

Found in version 28.0.50

Done: Pip Cet <pipcet <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 46834 <at> debbugs.gnu.org
Subject: Re: bug#46834: 28.0.50; byte-compiling the standard counter closure
 fails
Date: Mon, 01 Mar 2021 09:23:48 -0500
> diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
> index a2fe37a1ee586..7d00b453caf1c 100644
> --- a/lisp/emacs-lisp/bytecomp.el
> +++ b/lisp/emacs-lisp/bytecomp.el
> @@ -2785,16 +2785,12 @@ byte-compile--reify-function
>      (dolist (binding env)
>        (cond
>         ((consp binding)
> -        ;; We check shadowing by the args, so that the `let' can be moved
> -        ;; within the lambda, which can then be unfolded.  FIXME: Some of those
> -        ;; bindings might be unused in `body'.
> -        (unless (memq (car binding) args) ;Shadowed.
> -          (push `(,(car binding) ',(cdr binding)) renv)))
> +        (push `(,(car binding) ',(cdr binding)) renv))
>         ((eq binding t))
>         (t (push `(defvar ,binding) body))))
>      (if (null renv)
>          `(lambda ,args ,@preamble ,@body)
> -      `(lambda ,args ,@preamble (let ,(nreverse renv) ,@body)))))
> +      `(let ,renv (lambda ,args ,@preamble ,@body)))))

This looks good, thanks, but it changes the nature of the output of
`byte-compile` from a function value to an expression whose evaluation
returns a function value.  So I think we should tweak `byte-compile` so
it calls `eval` on the result in this particular case.


        Stefan





This bug report was last modified 4 years and 85 days ago.

Previous Next


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