GNU bug report logs - #6893
evaluating `'#'(lambda (b) b)8 ; => 8 with `eval-last-sexp' "C-x C-e" in `emacs-lisp-mode'

Previous Next

Package: emacs;

Reported by: MON KEY <monkey <at> sandpframing.com>

Date: Sat, 21 Aug 2010 21:54:02 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#6893: closed (evaluating `'#'(lambda (b) b)8 ; => 8 with
 `eval-last-sexp' "C-x C-e" in `emacs-lisp-mode')
Date: Sat, 21 Aug 2010 22:46:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 22 Aug 2010 00:40:17 +0200
with message-id <jwvr5hroakm.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#6893: evaluating `'#'(lambda (b) b)8 ; => 8 with `eval-last-sexp' "C-x C-e" in `emacs-lisp-mode'
has caused the GNU bug report #6893,
regarding evaluating `'#'(lambda (b) b)8 ; => 8 with `eval-last-sexp' "C-x C-e" in `emacs-lisp-mode'
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
6893: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6893
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: MON KEY <monkey <at> sandpframing.com>
To: bug-gnu-emacs <at> gnu.org
Subject: evaluating `'#'(lambda (b) b)8 ; => 8 with `eval-last-sexp' "C-x C-e"
	in `emacs-lisp-mode'
Date: Sat, 21 Aug 2010 17:55:03 -0400
Interactive invocation of `eval-last-sexp' (e.g. "C-x C-e" ) in
Emacs-lisp mode buffer for this form:

 `'#'(lambda (b) b)8
 ;=> 8

`eval-last-sexp' for this makes (some) sense:

 `'#'(lambda (b) b)
 ;=> (quote (function (lambda (b) b)))

And so, presumably the above is equivalent to:

 (eval '(list 'quote '(function (lambda (b) b))))
 ;=> (quote (function (lambda (b) b)))

But what is the equivalent form which would explain the results for
following:

 `'#'(lambda (b) b)8
 ;=> 8

Surely it isn't this:

 (funcall (eval (eval (eval '(list 'quote '(function (lambda (b) b)))))) 8)
 ;=> 8

If it is, then why is eval'ing the same `'#'(lambda (b) b)8 form with
`eval-expression' (e.g. "M-:") met with the message:

 "Trailing garbage following expression"

Likewise, giving `eval-expression' this form lands me in the debugger:

 (`'#'(lambda (b) b) 8)

 ;=> Debugger entered--Lisp error:
     (wrong-number-of-arguments #[(structure) "\301!A\207"
                                  [structure backquote-process] 2 1720176] 2)

Reproducable on 23.2 with emacs -Q

--
/s_P\


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: MON KEY <monkey <at> sandpframing.com>
Subject: Re: bug#6893: evaluating `'#'(lambda (b) b)8 ;
	=> 8 with `eval-last-sexp' "C-x C-e" in `emacs-lisp-mode'
Date: Sun, 22 Aug 2010 00:40:17 +0200
> Interactive invocation of `eval-last-sexp' (e.g. "C-x C-e" ) in
> Emacs-lisp mode buffer for this form:

>  `'#'(lambda (b) b)8
>  ;=> 8

C-x C-e doesn't evaluate "the expression on the line" but "the last sexp
before point".
The "last-sexp" is just "8" (try C-M-b to see what it is), so whatever
other sexp you put before won't make any difference.


        Stefan


This bug report was last modified 14 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.