From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Compiled vs. interpreted ERT test Date: Thu, 27 Feb 2020 21:18:23 -0500 Message-ID: References: <87r1yfr7vs.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74723"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:uoA4scy+eTLCrBP/FN++n7kMj+c= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 28 03:18:55 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7VEs-000JJz-Cs for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 28 Feb 2020 03:18:54 +0100 Original-Received: from localhost ([::1]:40716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7VEr-00055b-FF for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 27 Feb 2020 21:18:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53251) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7VEW-000533-4w for help-gnu-emacs@gnu.org; Thu, 27 Feb 2020 21:18:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7VEV-0007aT-5T for help-gnu-emacs@gnu.org; Thu, 27 Feb 2020 21:18:32 -0500 Original-Received: from ciao.gmane.io ([159.69.161.202]:44800) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7VEU-0007XF-Vn for help-gnu-emacs@gnu.org; Thu, 27 Feb 2020 21:18:31 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1j7VER-000Ioe-TD for help-gnu-emacs@gnu.org; Fri, 28 Feb 2020 03:18:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122495 Archived-At: > 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