Suggestion: Get rid of "java.lang.Exception: EOF while reading.."

385 views
Skip to first unread message

Gabi

unread,
Jan 27, 2010, 4:03:53 AM1/27/10
to Clojure
This exception is the biggest time waster for me when working with
Clojure. It doesn't give you a hint of where the problem really is.
I strongly suggest to improve parse error messages to contain
meaningful info.

Chouser

unread,
Jan 27, 2010, 11:22:30 AM1/27/10
to clo...@googlegroups.com

I just wrote a patch to LispReader that in many cases can produce
an exception like:

java.lang.Exception: EOF while reading, starting at line 7 (bad.clj:15)

So while bad.clj:15 indicates the file name and the fact that
line 15 is the last one of the file, "starting at line 7" points
out the line where the unclosed grouping construct started. This
might be useful.

Rich, care for a bug and patch for this?

--Chouser
http://joyofclojure.com/

Howard Lewis Ship

unread,
Jan 27, 2010, 12:29:28 PM1/27/10
to clo...@googlegroups.com
I too would love to see this. I can't tell you how many times I've
dropped a ) from a (ns and spent forever hunting it down.

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Gabi

unread,
Jan 27, 2010, 12:39:11 PM1/27/10
to Clojure
Yes Rich, Please approve this patch!

On Jan 27, 6:22 pm, Chouser <chou...@gmail.com> wrote:

Jarkko Oranen

unread,
Jan 27, 2010, 12:48:40 PM1/27/10
to Clojure
You should really give paredit.el a go some time. It feels silly to
worry about matching parentheses nowadays.

That aside, I am supportive of any improvement in either compiler or
reader error messages.

Vagif Verdi

unread,
Jan 27, 2010, 1:07:26 PM1/27/10
to Clojure
+1 for paredit. Writing lisp without an IDE geared towards the
language is miserable. Bracket matching is a must-have feature for
lisp programmer. Higher in importance than anything else.

Rich Hickey

unread,
Jan 27, 2010, 1:00:05 PM1/27/10
to Clojure

On Jan 27, 11:22 am, Chouser <chou...@gmail.com> wrote:


> On Wed, Jan 27, 2010 at 4:03 AM, Gabi <bugspy...@gmail.com> wrote:
> > This exception is the biggest time waster for me when working with
> > Clojure. It doesn't give you a hint of where the problem really is.
> > I strongly suggest to improve parse error messages to contain
> > meaningful info.
>
> I just wrote a patch to LispReader that in many cases can produce
> an exception like:
>
>   java.lang.Exception: EOF while reading, starting at line 7 (bad.clj:15)
>
> So while bad.clj:15 indicates the file name and the fact that
> line 15 is the last one of the file, "starting at line 7" points
> out the line where the unclosed grouping construct started.  This
> might be useful.
>
> Rich, care for a bug and patch for this?
>

Sure - thanks!

Rich

Chouser

unread,
Jan 27, 2010, 1:50:31 PM1/27/10
to clo...@googlegroups.com

Gabi

unread,
Jan 27, 2010, 2:40:26 PM1/27/10
to Clojure
Superb. Getting a fix so fast.. Open Source at its best!
I tried it. Works as expected.

On Jan 27, 8:50 pm, Chouser <chou...@gmail.com> wrote:

Laurent PETIT

unread,
Jan 28, 2010, 2:28:09 PM1/28/10
to clo...@googlegroups.com
For your information, there's a paredit port to ccw in progress :-)

2010/1/27 Howard Lewis Ship <hls...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages