Greetings, Clojure community.  I've been playing around with
clojure,
    and just downloaded 1.3.0. Here's a REPL session, wherein I define
    a power-of-two function, and apply it a couple of times.

lecturer-01:clojure-1.3.0 kangas$ java -cp clojure-1.3.0.jar
clojure.main
Clojure 1.3.0
user=> (defn pow2 [n]
          (loop [n n, p 1]
             (if (zero? n)
                p
                (recur (dec n) (+ p p)) )))
#'user/pow2
user=> (pow2 62)
4611686018427387904
user=> (pow2 63)
ArithmeticException integer overflow
clojure.lang.Numbers.throwIntOverflow (Numbers.java:1374)
user=>

    Previous versions would silently, automagically convert to bignums
and
    give me the answer I wanted.  Is clojure-1.3.0 too serious,
enterprisy, and
    Java-like for this sort of thing?  I found no clue in the list of
changes.

thanks,

George

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to