When I try to run this code in eclipse:
(ns cl1
(def s 1)
(print s)
)
I get
java.lang.Exception: No such var: clojure.core/def (clojure.clj:1)
I'm a complete clojure newbie, but I think that the above code should create the symbol s, and then print what s is equivalent to to the screen (1).
def isn't used inside an ns declaration (ns is a macro, btw). try this instead:
(ns cl1)
(def s 1)
(println s)
http://clojure.org/namespaces
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With