all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 24171@debbugs.gnu.org, Alex Vong <alexvong1995@gmail.com>
Subject: bug#24171: 25.1; Bytecode returns nil instead of expected closure
Date: Sun, 07 Aug 2016 10:44:31 -0400	[thread overview]
Message-ID: <jwva8gor6g9.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <877fbtqyhp.fsf@web.de> (Michael Heerdegen's message of "Sun, 07 Aug 2016 01:16:50 +0200")

> (defun test ()
>   (let ((my-cool-fun 'dummy))
>     (let ((my-cool-fun
>            (let ((calculate (lambda () 1)))
>              (lambda () (setq my-cool-fun calculate))))
>           (return-my-cool-fun (lambda () my-cool-fun)))
>       (funcall my-cool-fun)
>       (funcall return-my-cool-fun))))

Good catch.  It's a bug in cconv.el in the case where it decides to use
lambda-lifting.  It tries to handle such name-capture (search for "(when
(memq var new-extend)" in cconv.el to see where) but doesn't catch the
above case.

Don't have a fix yet.  For the above test case, you can circumvent the
bug by swapping the order of return-my-cool-fun and my-cool-fun in the
let binding.


        Stefan





  parent reply	other threads:[~2016-08-07 14:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-06 23:16 bug#24171: 25.1; Bytecode returns nil instead of expected closure Michael Heerdegen
2016-08-07  9:01 ` Andreas Schwab
2016-08-07  9:30   ` Clément Pit--Claudel
2016-08-07 11:24     ` Andreas Schwab
2016-08-07 22:57   ` Michael Heerdegen
2016-08-07 14:44 ` Stefan Monnier [this message]
2016-08-08  2:04 ` Stefan Monnier
2016-08-08 10:38   ` Alex Vong
2016-08-09 17:05     ` Stefan Monnier
2016-08-09  3:26   ` Michael Heerdegen
2016-08-09  3:48     ` Michael Heerdegen

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

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

  git send-email \
    --in-reply-to=jwva8gor6g9.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=24171@debbugs.gnu.org \
    --cc=alexvong1995@gmail.com \
    --cc=michael_heerdegen@web.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.