Export to GitHub

clojure - issue #96

In FOR macro the :let clause does not establish a lexical binding


Posted on Mar 14, 2009 by Swift Bird

> What (small set of) steps will reproduce the problem?

In a fresh Clojure: (for [a (range 5) :let [x (* a a)]] x) ==> java.lang.Exception: Unable to resolve symbol: x in this context

Now: (def x -1000) (for [a (range 5) :let [x (* a a)]] x) ==> (-1000 -1000 -1000 -1000 -1000)

> What is the expected output? What do you see instead?

It should be: (for [a (range 5) :let [x (* a a)]] x) ==> (0 1 4 9 16)

> What version are you using?

SVN r1327

Comment #1

Posted on Mar 14, 2009 by Swift Bird

Sorry, I have two clojure.jars on my system and I used an older one. In r1327 this bug does not longer exist. Please close the issue, thanks.

Comment #2

Posted on Mar 16, 2009 by Massive Dog

(No comment was entered for this change.)

Status: Invalid

Labels:
Type-Defect Priority-Low