unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Are there any problems with lexical-let or other cl-macros???
@ 2010-06-01 13:01 LanX
  2010-06-01 13:18 ` Pascal J. Bourguignon
  2010-07-15  0:13 ` Elena
  0 siblings, 2 replies; 10+ messages in thread
From: LanX @ 2010-06-01 13:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hi

http://steve-yegge.blogspot.com/2008/11/ejacs-javascript-interpreter-for-emacs.html
steve yegge complains about missing lexical vars roughly giving this
example

(require 'cl)
(defun foo ()
  (setq x 7))

(defun bar ()
  (let ((x 6))
    (foo)
    x))  ; you would expect x to still be 6 here

(message (number-to-string (bar)))

What I don't understand is that simply replacing let with lexical-let
will solve the problem.

IMHO "let" corresponds to "local" in perl while "lexical-let" is  "my"
and everything seems to work as expected...

What am I missing?

Whats the problem with using cl macros, do they introduce any new and
ugly side effects better avoided?

Cheers
  Rolf


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

end of thread, other threads:[~2010-07-20  7:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01 13:01 Are there any problems with lexical-let or other cl-macros??? LanX
2010-06-01 13:18 ` Pascal J. Bourguignon
2010-06-01 14:20   ` LanX
2010-06-01 15:45     ` Helmut Eller
2010-06-01 15:58       ` LanX
2010-06-01 16:24         ` Helmut Eller
2010-06-02 11:26           ` Pascal J. Bourguignon
2010-07-15  0:13 ` Elena
2010-07-19 22:44   ` Stefan Monnier
2010-07-20  7:56     ` Elena

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).