I\'m relatively new to Lisp, and I was wondering if there really is an upper limit to the \"+\" function.
(I guess this applies to all the other arithmetic function
It depends of the implementation. "I would suggest LISP users take 5 minutes to test their platform".
For Clojure
(defn find-max-n [n]
(try
(eval (concat (list +) (take n (repeat 1))))
(println "more than" n)
; return n if something goes wrong
(catch Exception e n))
(recur (* n 2)))
(find-max-n 1)
It doesn't terminate, it hangs at 8192 given my settings.
more than 1
more than 2
more than 4
more than 8
more than 16
more than 32
more than 64
more than 128
more than 256
more than 512
more than 1024
more than 2048
more than 4096
more than 8192