Welcome! Please see the About page for a little more info on how this works.

0 votes
in Syntax and reader by

At the REPL, I accidentally typed:

user=> 1. "\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).

6 Answers

0 votes
by

Comment made by: bronsa

No longer reproducible

0 votes
by

Comment made by: alexmiller

Seems at least partially reproducible to me. I see same behavior on first example. Second example works with a symbol 1. } but fails with a reasonable error on the given case.

0 votes
by

Comment made by: bronsa

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

0 votes
by

Comment made by: alexmiller

dunno

0 votes
by

Comment made by: alexmiller

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

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-878 (reported by glchapman)
...