Re: Improved compiler error messages, part 2

2008-09-19 Thread Rich Hickey
On Sep 18, 12:07 pm, Allen Rohner [EMAIL PROTECTED] wrote: Ok, I have a new one. Reader errors don't tell you the name of the file that had problems: eof.clj: (defn foo [a] (println hello) $ java -cp clojure.jar clojure.lang.Repl eof.clj java.lang.Exception: ReaderError:(3,1) EOF

Re: Improved compiler error messages, part 2

2008-09-18 Thread Rich Hickey
On Sep 17, 9:15 pm, Allen Rohner [EMAIL PROTECTED] wrote: Ok, concrete. Here's one mistake I made the other day. I created a ref, and then forgot to access it using @. The example code is (def my_map (ref {:a 1, :b 2})) (def map_vals (vals my_map)) $ java -cp clojure-clean.jar

Re: Improved compiler error messages, part 2

2008-09-18 Thread Allen Rohner
I've made some enhancements to the location info (rev 1031), see if that helps. Rich This looks good. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Improved compiler error messages, part 2

2008-09-18 Thread Allen Rohner
Ok, I have a new one. Reader errors don't tell you the name of the file that had problems: eof.clj: (defn foo [a] (println hello) $ java -cp clojure.jar clojure.lang.Repl eof.clj java.lang.Exception: ReaderError:(3,1) EOF while reading at

Re: Improved compiler error messages, part 2

2008-09-18 Thread Allen Rohner
Reader errors don't tell you the name of the file that had problems: eof.clj: (defn foo [a]    (println hello) $ java -cp clojure.jar clojure.lang.Repl eof.clj java.lang.Exception: ReaderError:(3,1) EOF while reading         at clojure.lang.LispReader.read(LispReader.java:164)        

Re: Improved compiler error messages, part 2

2008-09-17 Thread Rich Hickey
On Sep 17, 1:54 pm, Allen Rohner [EMAIL PROTECTED] wrote: After feedback on my previous compiler error message patch, I've started looking into the problem more. My goal is to have the file and line number printed on every user-visible stack trace. An example of my desired output is:

Re: Improved compiler error messages, part 2

2008-09-17 Thread Allen Rohner
It seems to me you need to distinguish runtime errors from compilation errors. For runtime errors, the file and line numbers are already in the stack trace, as Clojure emits that information in the bytecode. For example, in the above trace:         at