On Nov 14, 6:48 am, Robert McIntyre <[email protected]> wrote: > So my friend and I were screwing around, battling versions of LISP as > nerds are wont to do, when I came across this: > > (eval `(clojure.core/+ ~@(take 1e4 (iterate inc 1)))) > Invalid method Code length 89884 in class file user$eval13607 > > This is just trying to evaluate + directly on a bunch of arguments. > > Common Lisp on my friend's 30 year old Lisp machine does the > equivalent of this with ease, even for much larger numbers. > > As I'm writing this, my "friend" is rubbing in this in my face by also > doing the above with C-LISP on his laptop. (although his stack > overflows for 1e5) > > I'm losing my battle!!! :( > Pls. help!
It's not a CL vs Clojure issue, rather a typical-CL-implementation vs JVM, as you're hitting the JVM method size limit (64K iirc). For example ABCL is a Common Lisp targeting the JVM and it has the same problem, not with eval but with files containing many functions (since it generates one big "loader" method for the whole file, and if there are a lot of functions in the file, that method becomes too big). Of course, since Clojure is strongly tied to the JVM, while CL is an open standard with multiple implementations, your friend is not completely wrong ;) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
