Right Rich, Thanks. But that was a simplified reduction of real usage.
Typically the declare is found in a nested structure:
(describe something
(context fooey
(with bar 42) ; declare comes from this macro
(it works
(should= 42
2011/10/25 Micah Martin micahmar...@gmail.com:
Right Rich, Thanks. But that was a simplified reduction of real usage.
Typically the declare is found in a nested structure:
(describe something
(context fooey
(with bar 42) ; declare comes from this macro
Thanks for the explanation All. I have a much better grasp of what's going on
now.
Just one more question: It is defined behavior, or should I submit a patch for
Clojure 1.3?
Micah
On Oct 20, 2011, at 7:55 PM, Chouser wrote:
On Thu, Oct 20, 2011 at 4:31 PM, Chris Perkins
You should use 'do' for that kind of thing, not list.
Rich
On Oct 20, 2011, at 1:53 PM, Micah Martin wrote:
I recently tried to get Speclj running on Clojure 1.3 and came across the
following problem:
(list
(declare ^:dynamic p)
(defn q [] @p))
(binding [p (atom 10)]
(q))
I recently tried to get Speclj running on Clojure 1.3 and came across the
following problem:
(list
(declare ^:dynamic p)
(defn q [] @p))
(binding [p (atom 10)]
(q))
java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to
clojure.lang.IDeref
Thanks to @cemerick for
Hi,
Am 20.10.2011 um 19:53 schrieb Micah Martin:
I recently tried to get Speclj running on Clojure 1.3 and came across the
following problem:
(list
(declare ^:dynamic p)
(defn q [] @p))
(binding [p (atom 10)]
(q))
java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be
To put it another way: a top-level do is special-cased to compile and
then immediately execute each contained form, in order. Any other top-level
form, such as list, will be fully compiled, including all contained forms,
and only then executed. In this case, the defn cannot compile because the
Note: I forgot to preface that with I think... :) Upon experimenting
briefly, it turns out I was wrong about how Clojure works (that seems to
happen a lot with me). A declare/def defines a var even when it's not
executed!
user (defn xxx [] (declare yyy))
#'user/xxx
user yyy
#Unbound Unbound:
On Thu, Oct 20, 2011 at 4:31 PM, Chris Perkins chrisperkin...@gmail.com wrote:
Note: I forgot to preface that with I think... :) Upon experimenting
briefly, it turns out I was wrong about how Clojure works (that seems to
happen a lot with me). A declare/def defines a var even when it's not