GNU bug report logs -
#11782
24.1; closure is not self-quoting
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11782 in the body.
You can then email your comments to 11782 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11782
; Package
emacs
.
(Mon, 25 Jun 2012 18:52:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Christopher Schmidt <christopher <at> ch.ristopher.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 25 Jun 2012 18:52:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I am not exactly sure if this is a bug, a feature or something that is
just undefined.
(funcall (eval (eval '(let ((var)) (lambda ())))))
works fine, whereas
(funcall (eval (eval '(let ((lex-var)) (lambda ())) t)))
does not work.
Backtrace:
Debugger entered--Lisp error: (void-function closure)
(closure ((lex-var) t) nil)
eval((closure ((lex-var) t) nil))
(funcall (eval (eval (quote (let ((lex-var)) (lambda nil))) t)))
eval((funcall (eval (eval (quote (let ((lex-var)) (lambda nil))) t))))
I am on GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version
2.24.10).
Christopher
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11782
; Package
emacs
.
(Fri, 20 Jul 2012 12:20:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 11782 <at> debbugs.gnu.org (full text, mbox):
> (funcall (eval (eval '(let ((lex-var)) (lambda ())) t)))
> does not work.
Note that (eval (eval '(cons 1 2))) does not work either.
So I don't consider it a bug.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11782
; Package
emacs
.
(Fri, 20 Jul 2012 13:45:02 GMT)
Full text and
rfc822 format available.
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
Thanks for your answer.
>> (funcall (eval (eval '(let ((lex-var)) (lambda ())) t)))
>> does not work.
>
> Note that (eval (eval '(cons 1 2))) does not work either.
> So I don't consider it a bug.
That's true, of course. Lambdas are an exception in Emacs Lisp and
CL, though.
(info "(elisp)Lambda Expressions")
In Emacs Lisp, such a list is valid as an expression--it evaluates
to itself. But its main use is not to be evaluated as an
expression, but to be called as a function.
I stumbled upon this issue a few times already. So did others.
http://stackoverflow.com/questions/7913207/how-does-the-definition-for-apply-partially-work-in-emacs-24
IMO the info node I referenced above should mention this.
Christopher
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11782
; Package
emacs
.
(Sat, 23 Feb 2013 14:56:02 GMT)
Full text and
rfc822 format available.
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
Ping?
(I think the issue I describe is a severe bug.)
Christopher
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11782
; Package
emacs
.
(Tue, 28 May 2013 20:43:02 GMT)
Full text and
rfc822 format available.
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
> (I think the issue I describe is a severe bug.)
Could you expand on why you think it's severe?
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11782
; Package
emacs
.
(Tue, 28 May 2013 22:38:01 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
Hi Stefan,
> Could you expand on why you think it's severe?
I think this issue is severe because the behaviour is odd and follows
neither other mature Lispy languages nor the reference manual.
(info "(elisp)Lambda Expressions")
In Emacs Lisp, such a list is valid as an expression--it evaluates
to itself.
As I said 11 month ago, I hit on this issue a few times already. So did
others. In most cases I had a lambda form that was eval'ed twice due to
macro expansion.
;; -*- lexical-binding: t -*-
(defmacro a ()
(let ((l (lambda () )))
`(funcall ,l)))
(a)
I realise there is a technical need for lambda's to evaluate to closures
in a lexical environment. Are there any technical reasons for lexical
closures to not self-quote?
BTW I am perfectly fine with just fixing the docs.
Christopher
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11782
; Package
emacs
.
(Wed, 29 May 2013 00:28:01 GMT)
Full text and
rfc822 format available.
Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):
>> Could you expand on why you think it's severe?
> I think this issue is severe because the behaviour is odd and follows
> neither other mature Lispy languages nor the reference manual.
I see. So we just disagree on what is considered severe (I expected
something like "this and that common idiom found in those packages fails").
In Emacs Lisp, such a list is valid as an expression--it evaluates
to itself.
Clearly this doc needs to be fixed since it confuses lambda expressions
and lambda values and while this conflation mostly worked in dynamic
binding, it does not work any more in the presence of closures. I just
installed the patch below.
Stefan
--- doc/lispref/functions.texi 2013-01-01 09:11:05 +0000
+++ doc/lispref/functions.texi 2013-05-29 00:16:58 +0000
@@ -196,9 +196,8 @@
@end example
@noindent
-In Emacs Lisp, such a list is valid as an expression---it evaluates to
-itself. But its main use is not to be evaluated as an expression, but
-to be called as a function.
+In Emacs Lisp, such a list is a valid expression which evaluates to
+a function object.
A lambda expression, by itself, has no name; it is an @dfn{anonymous
function}. Although lambda expressions can be used this way
Reply sent
to
Christopher Schmidt <christopher <at> ch.ristopher.com>
:
You have taken responsibility.
(Wed, 29 May 2013 07:08:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Christopher Schmidt <christopher <at> ch.ristopher.com>
:
bug acknowledged by developer.
(Wed, 29 May 2013 07:08:03 GMT)
Full text and
rfc822 format available.
Message #28 received at 11782-done <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> In Emacs Lisp, such a list is valid as an expression--it evaluates
> to itself.
>
> Clearly this doc needs to be fixed since it confuses lambda
> expressions and lambda values and while this conflation mostly worked
> in dynamic binding, it does not work any more in the presence of
> closures. I just installed the patch below.
Thanks a lot!
Christopher
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 26 Jun 2013 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 362 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.