% java -cp clojure.jar clojure.main
Clojure 1.1.0-alpha-SNAPSHOT
user=> (def a)
#'user/a
user=> (binding [a 4] a)
java.lang.IllegalStateException: Var user/a is unbound.
(NO_SOURCE_FILE:0)
user=>
With svn r1369, I get this:
% java -cp clojure.jar clojure.main
Clojure 1.1.0-alpha-SNAPSHOT
user=> (def a)
#'user/a
user=> (binding [a 4] a)
4
user=>
I expected the r1369 behavior.
--Steve
Fixed in 1373 - thanks for the report!
Rich
On May 25, 2009, at 7:11 AM, Frantisek Sodomka wrote:
> (def a)
> (deftest test-binding
> (are (= _1 _2)
> (binding [a 4] a) 4 ; regression in Clojure SVN r1370
> ))
I see those tests going in over time... Thanks so much for making them!
The checkin notes for this change mention "top level". I suspect
that's related to why the test you posted gave a false pass.
We can use eval to bring the test up to the top level:
(def a)
(deftest test-binding
(are (= _1 _2)
(eval `(binding [a 4] a)) 4 ; regression in Clojure SVN r1370
))
This passes with r1375 and fails with r1370.
Will this be our first test in clojure-contrib.test-clojure.vars?
Feel free to check this in or let me know if you'd like me to.
Thanks,
--Steve