[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lexical-binding questions
From: |
Stefan Monnier |
Subject: |
Re: lexical-binding questions |
Date: |
Sat, 05 May 2012 09:26:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
> it seem C-M-x is not working as expected in a `lexical-binding' enabled
> buffer:
> #+BEGIN_SRC emacs-lisp
> ;; -*- lexical-binding: t -*-
> (defun foo ()
> (declare (special bar))
> (let ((bar 2)
> (baz 3))
> #'(lambda () (+ bar baz))))
> ;; I expect this:
> ;; (funcall (foo))
> ;;=>Symbol's value as variable is void: bar
> #+END_SRC
> However, (funcall (foo)) return 5 until I byte-compile and load the
> file.
What makes you think this has something to do with C-M-x? AFAICT it's
just a difference between interpreted and compiled code, because
CL's (declare (special bar)) has not been adapted to lexical-binding.
> So my question is how do you evaluate such code when working in a
> `lexical-binding' enabled buffer?
You don't use (declare (special bar)).
Stefan
- Re: BEGIN_SRC..END_SRC, (continued)
- Re: BEGIN_SRC..END_SRC, Bastien, 2012/05/05
- Re: BEGIN_SRC..END_SRC, Eli Zaretskii, 2012/05/05
- Re: BEGIN_SRC..END_SRC, Bastien, 2012/05/06
- Re: BEGIN_SRC..END_SRC, Eli Zaretskii, 2012/05/06
- Re: BEGIN_SRC..END_SRC, Lars Magne Ingebrigtsen, 2012/05/06
Re: lexical-binding questions, Stefan Monnier, 2012/05/05
Re: lexical-binding questions, Thierry Volpiatto, 2012/05/06
Re: lexical-binding questions,
Stefan Monnier <=
Re: lexical-binding questions, egnarts-ms, 2012/05/13