Search code examples
clojure

Why won't this print out anything?


Why won't this print out anything, but it works if i just use (print "ASDAS") ,I'm using LightTable and It's printint out in the console.

(defn try [x]
 (print ("ASDASD")
))

(try 5) 

Solution

  • try is a special form for exception handling. See the Clojure Documentation for it.

    You can either:

    • Refer to it directly via (your-ns-here/try 5), likely (user/try 5).
    • Use a different name for your function.