2009/3/29 Stephen C. Gilardi <squee...@mac.com> > > On Mar 28, 2009, at 10:31 PM, Glen Stampoultzis wrote: > > It wasn't really this specific problem that I wanted to point out but more >> to trigger a rethink of how errors are reported back to the user. >> > > I understand, but without specifying which Clojure you're using and giving > an example of how it happened, it's hard to compare our results. >
Sorry when I said the latest released version of clojure I thought that would be enough to go on. I was using clojure_20090320.zip which matches your version. > > Here's an example that gives an error somewhat similar to the one I >> posted: >> >> (defn testing [a b] (print a b)) >> (testing) >> >> java.lang.NoSuchMethodError: >> java.lang.Class.getSimpleName()Ljava/lang/String; (testing.clj:0) >> [ and lots more stack trace ] >> >> > > Here's what I get with clojure_20090320 downloaded from: > > http://code.google.com/p/clojure/downloads/list > > % java -cp clojure.jar clojure.main > Clojure > user=> (defn testing [a b] (print a b)) > #'user/testing > user=> (testing) > java.lang.IllegalArgumentException: Wrong number of args passed to: > user$testing (NO_SOURCE_FILE:0) > user=> > > That's quite different from your result and I think more in line with what > you're requesting. Are you able to reproduce this result using the Clojure > version I referenced? > > --Steve > > The difference was that I wasn't running through the REPL. When I run through the REPL I get the same result as you. If you run the code from a file you get: C:\products\clojure>java -cp clojure.jar clojure.main test.clj java.lang.IllegalArgumentException: Wrong number of args passed to: user$testing (test.clj:0) at clojure.lang.Compiler.eval(Compiler.java:4533) at clojure.lang.Compiler.load(Compiler.java:4846) at clojure.lang.Compiler.loadFile(Compiler.java:4813) at clojure.main$load_script__5793.invoke(main.clj:206) at clojure.main$script_opt__5824.invoke(main.clj:258) at clojure.main$main__5848$fn__5850.invoke(main.clj:333) at clojure.main$main__5848.doInvoke(main.clj:328) at clojure.lang.RestFn.invoke(RestFn.java:413) at clojure.lang.Var.invoke(Var.java:346) at clojure.lang.AFn.applyToHelper(AFn.java:173) at clojure.lang.Var.applyTo(Var.java:463) at clojure.main.main(main.java:39) Caused by: java.lang.IllegalArgumentException: Wrong number of args passed to: user$testing at clojure.lang.AFn.throwArity(AFn.java:449) at clojure.lang.AFn.invoke(AFn.java:48) at user$eval__4.invoke(test.clj:2) at clojure.lang.Compiler.eval(Compiler.java:4522) ... 11 more I think part of my problem is that I'm thinking of it as a compile error when actually it's a runtime error. Even so most of the stack is unnecessary - would it be feasible (or even desirable) to strip the parts not relevant to the user? --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---