help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Are there any problems with lexical-let or other cl-macros???


From: LanX
Subject: Are there any problems with lexical-let or other cl-macros???
Date: Wed, 08 Dec 2010 15:10:52 -0000
User-agent: G2/1.0

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]