help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiled vs. interpreted ERT test


From: Stefan Monnier
Subject: Re: Compiled vs. interpreted ERT test
Date: Thu, 27 Feb 2020 21:18:23 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I opened an issue on the package's Github page but the maintainer says he
> doesn't know how to debug this.[2] So I'm coming here in the hopes someone
> has an idea or a suggestion how to debug this.

I haven't looked at the rest of the code, but the first thing I saw is:

    (defmacro wsi-current-lexical-environment ()
      "Return the current lexical environment.
    
    If `lexical-binding' is not enabled, return nil.
    
    This macro expands to a Lisp form that evaluates to the current
    lexical environment. It works by creating a closure and then
    extracting and returning its lexical environment.
    
    This can be used to manually construct closures in that
    environment."
      `(let ((temp-closure (lambda () t)))
         (when (eq (car temp-closure) 'closure)
           (cadr temp-closure))))

which clearly assumes the code is interpreted since once compiled,
`temp-closure` is not going to be a list any more (and you won't be
able to extract the lexical env from it).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]