GNU bug report logs - #46722
test-map-into fails

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Tue, 23 Feb 2021 16:23:01 UTC

Severity: normal

Merged with 53365

Found in versions 27.2, 28.0.50, 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: dick <dick.r.chiang <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, smonnier <smonnier <at> iro.umontreal.ca>, Stefan Kangas <stefan <at> marxist.se>, contovob <at> tcd.ie, 46722 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: bug#46722: test-map-into fails
Date: Wed, 05 Jan 2022 10:17:19 -0500
> You can't do,
>
> (funcall
>  (funcall
>   (backquote
>    (lambda (arg)
>      (lambda () arg)))
>   t))
>
> which is what `cl--generic-get-dispatcher` tries to do.

Is it?  Where does `cl--generic-get-dispatcher` do that?

Oh, you mean we don't guarantee that we use static scoping?
I think I see what mean.
Does the patch below help?


        Stefan


diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 983694204df..686a2375971 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -644,7 +644,8 @@ cl--generic-get-dispatcher
       ;; FIXME: For generic functions with a single method (or with 2 methods,
       ;; one of which always matches), using a tagcode + hash-table is
       ;; overkill: better just use a `cl-typep' test.
-      (byte-compile
+      (funcall
+       (lambda (exp) (let ((lexical-binding t)) (byte-compile exp)))
        `(lambda (generic dispatches-left methods)
           ;; FIXME: We should find a way to expand `with-memoize' once
           ;; and forall so we don't need `subr-x' when we get here.





This bug report was last modified 3 years and 124 days ago.

Previous Next


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