[CLJ-1003] :100 is a valid Clojure keyword. Is that intentional? Created: 27/May/12 Updated: 06/Sep/13 Resolved: 06/Sep/13
In the latest clojure (eccde24c7),
These parse as keywords:
This is an error:
Is this behavior intentional?
In LispReader.java, the pattern for a symbol (and keyword) is "[:]?([\\D&&[^/]].*/)?([
http://clojure.org/reader says that none of my examples should parse.
Clojurescript does not accept any of my examples, see
|Comment by Andy Fingerhut [ 13/Sep/12 6:34 PM ]|
The reason that :100 parses as a keyword is that [
Whether this is intentional or not, my guess is probably not. Given that the docs at http://clojure.org/reader also say "A symbol can contain one or more non-repeating ':'s", writing a regexp that matches only what is documented there looks fairly complex.
Clojure has a history of allowing things, without throwing exceptions or giving any other errors, even if they are documented as not legal. This may be one of those cases. Do not consider this last paragraph as any kind of authoritative answer. It is only my observation.
|Comment by Andy Fingerhut [ 05/Sep/13 5:26 PM ]|
Perhaps this should be marked as duplicate of
|Comment by Alex Miller [ 06/Sep/13 7:50 AM ]|