comp.emacs
[Top] [All Lists]

Is lexical closure of elisp weeker than in clisp?

Subject: Is lexical closure of elisp weeker than in clisp?
From: Daneel Yaitskov
Date: Fri, 08 Aug 2008 20:25:30 +0400
Newsgroups: comp.emacs

The snippet of the lisp code:

(defun create-counter (start)
  #'(lambda () (setq start (+ start 1))))


It works in the common lisp but not in the emacs lisp.
The CL creates successfully the counter-functional.
This snippet works in elisp only when it stands in a environment where
exist the start variable:

        (setq start)
or
(let (start) ....

I want to ask is any device exist to do same in the elisp environment.


Daneel


<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy