all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15139: 24.3; Error in section 11.9.3 of the Elisp Reference Manual
@ 2013-08-20  8:54 Sian Mountbatten
  2013-08-20 11:08 ` Thierry Volpiatto
  0 siblings, 1 reply; 2+ messages in thread
From: Sian Mountbatten @ 2013-08-20  8:54 UTC (permalink / raw
  To: 15139

In section 11.9.3 Lexical Binding of the Elisp Reference Manual, the
following forms are given:

(defvar my-ticker nil)  ; comment

(let ((x 0))
     (setq my-ticker (lambda ()
                       (setq x (1+ x)))))

(funcall my-ticker)

The manual says that the 3rd form (funcall...) yields `1'. When these
forms are evaluated using C-xC-e, the 3rd form enters the debugger with
the error `void variable x'.

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2)
 of 2013-06-25 on sochi, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux unstable (sid)

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: eo.UTF-8
  value of $LC_COLLATE: eo.UTF-8
  value of $LC_CTYPE: eo.UTF-8
  value of $LC_MESSAGES: eo.UTF-8
  value of $LC_MONETARY: eo.UTF-8
  value of $LC_NUMERIC: eo.UTF-8
  value of $LC_TIME: eo.UTF-8
  value of $LANG: eo.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
n o w SPC a l m o s t SPC w o r k i n g SPC s a t i 
s f a c t o r i l y . SPC A l l SPC t h a t ' s SPC 
m i s s i n g SPC i s SPC a SPC D e b i a n SPC m e 
n u . <backspace> , SPC b u t SPC t h a t SPC w i l 
l SPC c o m e . < / P <backspace> p > <return> C-x 
C-s C-x k <return> <help-echo> <help-echo> <help-echo> 
<help-echo> C-x C-f s r c / h t m l / g w m <tab> - 
<tab> <backspace> - m a n <tab> <return> C-s p r o 
v i d e s C-s C-s C-s <right> <left> <backspace> C-s 
C-s <right> <left> <backspace> C-s C-s <right> <left> 
<backspace> C-s C-s C-s C-s <up> C-x C-s <help-echo> 
C-x k <return> C-x o SPC <tab> <return> <help-echo> 
<help-echo> <help-echo> <down-mouse-5> <mouse-5> <help-echo> 
<down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5> <help-echo> 
l SPC SPC <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <up> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> C-h f C-g <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> C-x C-e <down> 
<down> <down> <down> C-x C-e q <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> 
<help-menu> <send-emacs-bug-report>

Recent messages:
Saving file /home/sian/Retejo/blog/engblog.html...
Wrote /home/sian/Retejo/blog/engblog.html
Making completion list...
Mark saved where search started [4 times]
Saving file /home/sian/src/html/gwm-2.0-manual.html...
Wrote /home/sian/src/html/gwm-2.0-manual.html
Quit
(lambda nil (setq x (1+ x)))
Entering debugger...
Back to top level.

Load-path shadows:
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell

Features:
(shadow sort gnus-util mail-extr emacsbug message cl-macs gv format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils skeleton sgml-mode debug make-mode
help-fns bookmark pp misearch multi-isearch cc-langs cl cl-lib cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs etags ring help-mode apropos dired jka-compr info easymenu
desktop time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
Sian Mountbatten (home web-site http://www.poenikatu.co.uk/>)
Learning C++11 from the C++ Primer 5th edition.
I'm an associate FSF member (no. 10888).
Help us support software freedom! http://www.fsf.org/jf?referrer=10888





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#15139: 24.3; Error in section 11.9.3 of the Elisp Reference Manual
  2013-08-20  8:54 bug#15139: 24.3; Error in section 11.9.3 of the Elisp Reference Manual Sian Mountbatten
@ 2013-08-20 11:08 ` Thierry Volpiatto
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Volpiatto @ 2013-08-20 11:08 UTC (permalink / raw
  To: 15139

Sian Mountbatten <poenikatu@fastmail.co.uk> writes:

> In section 11.9.3 Lexical Binding of the Elisp Reference Manual, the
> following forms are given:
>
> (defvar my-ticker nil)  ; comment
>
> (let ((x 0))
>      (setq my-ticker (lambda ()
>                        (setq x (1+ x)))))
>
> (funcall my-ticker)
>
> The manual says that the 3rd form (funcall...) yields `1'. When these
> forms are evaluated using C-xC-e, the 3rd form enters the debugger with
> the error `void variable x'.

The manual is speaking of lexical binding, try this or use the code
above in a lexical-binding environment:

(defvar my-ticker nil)  ; comment

(lexical-let ((x 0))
  (setq my-ticker (lambda ()
                    (setq x (1+ x)))))

(funcall my-ticker)

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-20 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20  8:54 bug#15139: 24.3; Error in section 11.9.3 of the Elisp Reference Manual Sian Mountbatten
2013-08-20 11:08 ` Thierry Volpiatto

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.