cljs.tools.reader does not handle double-colon keywords

Description

In tools.reader 1.0.0-beta3, cljs.tools.reader/read-string incorrectly parses double-colon keywords such as ::blah and ::s/blah.

(read-string "::blah") returns a keyword with an empty-string namespace "", equivalent to:

(read-string "::s/blah") throws a reader exception:

In contrast, the JVM Clojure version returns the expected contextually namespaced keywords.

Environment

Clojure 1.9.0-alpha14 with ClojureScript 1.9.293.

Activity

Show:
Nicola Mometto
March 3, 2017, 11:15 AM

This is not a problem with tools.reader, rather an inherent problem with how tools.reader has to work around clojurescript's lack of reified namespaces.

To allow resolving namespaces, cljs.tools.reader relies on the value of `cljs.core/ns` and `cljs.tools.reader/alias-map`, which the user of `cljs.tools.reader` is responsible for setting up.

Declined

Assignee

Nicola Mometto

Reporter

import

Labels

Approval

None

Patch

None

Priority

Major