Clojure

:100 is a valid Clojure keyword. Is that intentional?

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

In the latest clojure (eccde24c7),

These parse as keywords:

:100
:100/a

This is an error:

:a/100

Is this behavior intentional?

In LispReader.java, the pattern for a symbol (and keyword) is "[:]?([\\D&&[^/]].*/)?([
D&&[^/]][^/]*)". If I'm mentally parsing that correctly, it seems like none of my examples should be valid keywords. I don't know why the first two cases parse.

http://clojure.org/reader says that none of my examples should parse.

Clojurescript does not accept any of my examples, see CLJS-142

Activity

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: