Subject: bug#24171: 25.1; Bytecode returns nil instead of expected closure

From: Clément Pit--Claudel <[email-masked]>
Date: Sun, 7 Aug 2016 05:30:31 -0400

On 2016-08-07 05:01, Andreas Schwab wrote:
> Michael Heerdegen <[email-masked]> writes:
> 
>> eval this defun:
>>
>> (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))))
>>
>> (test) evals to a closure as expected.
> 
> ELISP> (test)
> *** Eval error ***  Symbol’s value as variable is void: calculate

I can reproduce this. Andreas, are you missing ;; -*- lexical-binding: t; -*- ?

Clément.