DispatchReader always calls CtorReader when no dispatch macro found

Description

At the REPL, I accidentally typed:

user=> # "\w+"
RuntimeException Unsupported escape character: \w clojure.lang.Util.runtimeExce
ption (Util.java:156)
#<core$PLUS clojure.core$PLUS@6b7dc78>

You can see the confusing result (the REPL is also left in an unclosed string). After looking at LispReader.java, it seems to me DispatchReader ought to at least check for whitespace before calling CtorReader (perhaps better would be to check for a valid symbol character).

Environment

Windows 7, Java 1.7

Activity

Show:

Alex MillerAugust 3, 2015 at 1:53 AM

Removed 2nd (no longer present) example in description.

Alex MillerMarch 26, 2015 at 4:06 AM

dunno

Nicola MomettoMarch 26, 2015 at 3:56 AM

Ah, right.
The only way to fix the first error is to make `# "\w+"` a valid regex literal, that is, allowing whitespaces between # and the next dispatch char.
Is this something we want?

Alex MillerMarch 26, 2015 at 3:33 AM

Seems at least partially reproducible to me. I see same behavior on first example. Second example works with a symbol # user.X[5] but fails with a reasonable error on the given case.

Nicola MomettoMarch 25, 2015 at 11:33 PM

No longer reproducible

Won't Fix

Details

Assignee

Reporter

Labels

Priority

Affects versions

Created November 15, 2011 at 11:28 PM
Updated January 19, 2022 at 10:26 PM
Resolved January 19, 2022 at 10:26 PM