Questions tagged [clojure-1.3]

Clojure is a dialect of the Lisp programming language. Version 1.3.0 was released on September 23rd, 2011.

Clojure is a dialect of the Lisp programming language. Clojure 1.3.0 was released on September 23rd, 2011. Release notes for this version are available on the Clojure project website.

4 questions
8
votes
2 answers

defmulti vs defprotocol?

It seems like both can be used to define functions that you can implement later, with different data types. AFAIK the major difference is that defmulti works on maps and defprotocol works on records. What other differences there? What are the…
wrongusername
  • 18,564
  • 40
  • 130
  • 214
7
votes
2 answers

Not getting integer overflow in Clojure?

I am running Clojure 1.3.0 with La Clojure in IntelliJ IDEA while reading The Joy Of Clojure, and on section 4.1.3 (page 64), the authors demonstrate integer overflow with the following code: (+ Integer/MAX_VALUE Integer/MAX_VALUE) ;=>…
wrongusername
  • 18,564
  • 40
  • 130
  • 214
5
votes
1 answer

Clojure symbol evaluation error

So I currently have this code: (ns contact-form.core (:gen-class)) (def foo "Hello World!") (defn some-func [a-symbol] (println (str a-symbol "'s value is: " (eval a-symbol)))) (defn -main [& args] (some-func 'foo)) After I do C-c C-k in…
wrongusername
  • 18,564
  • 40
  • 130
  • 214
2
votes
1 answer

Finding the position of an object in a sequence in Clojure

Essentially, I want a function that works like this: user=> (pos 'c '(a b c d e f g) =) 2 user=> (pos 'z '(a b c d e f g) =) nil And I came up with this: (defn pos "Gets position of first object in a sequence that satisfies match" [object…
wrongusername
  • 18,564
  • 40
  • 130
  • 214