unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mark A. Hershberger" <mah@nichework.com>
To: Andrea Corallo <akrl@sdf.org>
Cc: 45056@debbugs.gnu.org
Subject: bug#45056: 28.0.50; lexical-let doesn't work with returned closures on nativecomp
Date: Sun, 06 Dec 2020 14:55:20 -0500	[thread overview]
Message-ID: <87v9deiuaf.fsf@everybody.org> (raw)
In-Reply-To: <xjfpn3n1awy.fsf@sdf.org> (Andrea Corallo's message of "Sun, 06 Dec 2020 10:33:33 +0000")

Andrea Corallo <akrl@sdf.org> writes:

> "Mark A. Hershberger" <mah@nichework.com> writes:
>
>> On Dec 5, 2020, at 5:06 PM, Andrea Corallo akrl@sdf.org wrote:
>>> could you provide a reproducer I can load and run possibly with -batch?
>>
>> I'm not sure how to do that since the file executed with -batch would be eval'd at runtime and this is using compiled code.
>
> this is not a problem, from batch one can always run
>
> (load (native-compile ".../test.el"))
> (test-entry-point)
>
> What we are interested in here is "test.el".

Here is test.el:

--- start test.el ---
(eval-when-compile
  (require 'cl))

(defun test-lambda (msg)
  "A test lambda that doesn't get the MSG."
  (lexical-let ((msg msg))
    (lambda (proc event-type)
      (message (concat "this is the message: " msg)))))

(defun test-entry-point ()
  "Demonstrate the problem."
  (message "before")
  (make-process
   :name "demo"
   :command (list "/bin/true")
   :sentinel (test-lambda "boom"))
  (sleep-for 0 500))
--- end test.el ---

Here is the output I get from emacs' master branch vs the native-comp
branch:

--- without native-compile ---
$ emacs --batch --eval '(progn (load "/home/mah/test.el") (test-entry-point))'
Loading /home/mah/test.el (source)...
Package cl is deprecated
before
this is the message: boom
--- end without native-compile ---

--- with native-compile ---
$ emacs --batch --eval '(progn (load (native-compile "/home/mah/test.el")) (test-entry-point))'

In toplevel form:
test.el:2:13: Warning: Package cl is deprecated
Loading /home/mah/.emacs.d/eln-cache/28.0.50-x86_64-pc-linux-gnu-0614bf52f1a04effb8fa710bbd17ffb5/test-82cb1d36939659f32d2428302ae393bd-703fa204fc5f510a11ffb237d3150bfe.eln (native compiled elisp)...
before
--- end with native-compile ---

Note that this shows a difference, but not necessarily the one I was
after originally. I was expecting a complaint about 'msg' not being
defined.

Running this interactively behaves differently (I get "this is the
message: boom"), so I think this shows a different bug than the one I
originally described.





  reply	other threads:[~2020-12-06 19:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05 18:16 bug#45056: 28.0.50; lexical-let doesn't work with returned closures on nativecomp Mark A. Hershberger via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-05 19:49 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-05 21:21   ` Mark A. Hershberger
2020-12-05 21:57     ` Mark A. Hershberger
2020-12-05 22:06       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-06  0:26         ` Mark A. Hershberger
2020-12-06 10:33           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-06 19:55             ` Mark A. Hershberger [this message]
2020-12-07 15:45               ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-08 14:59                 ` Mark A. Hershberger
2020-12-08 15:18                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-08 20:45                     ` Mark A. Hershberger
2020-12-08 21:28                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-08 21:42                         ` Mark A. Hershberger
2020-12-08 22:21                           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-29 22:06                             ` Mark A. Hershberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9deiuaf.fsf@everybody.org \
    --to=mah@nichework.com \
    --cc=45056@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).