Hey,
You have too many colons:
user= (read-string :l/test)
:l/test
Dave
On Tue, Sep 17, 2013 at 4:03 PM, Casper Clausen casp...@gmail.com wrote:
I am reading a bunch of clojure files using the build-in reader (or
tools.reader, it has the same problem) and I am running into a problem
I am reading a bunch of clojure files using the build-in reader (or
tools.reader, it has the same problem) and I am running into a problem
regarding namespaced keywords (is that the right term?) such as ::l/test.
= (read-string ::l/test)
RuntimeException Invalid token: ::l/test
The double colon keyword creates a namespaced keyword and is perfectly
valid syntax. It's just not used that often :)
By default a keyword like ::test resolves to the current namespace like
::current-ns/test, but you can also provide another ns which causes the
problem when reading.
Have at
A namespace-qualified keyword has a single colon:
:my-namespace/something
The double-colon is only shorthand for the current namespace:
(in-ns 'my-namespace)
::something - :my-namespace/something
Dave
On Tue, Sep 17, 2013 at 4:58 PM, Casper Clausen casp...@gmail.com wrote:
The double
Casper, in the example source file you pointed at in the core.logic test
suite, the only times it uses the ::namespace/symbol syntax is where
namespace is an alias for a namespace that has been created by an earlier
:require statement.
In my limited testing in Clojure 1.5.1, that syntax throws an
It is used in test.generative code by Stuart Halloway, which is probably
about as supported as you can get:
https://github.com/clojure/test.generative/blob/master/src/main/clojure/clojure/test/generative/runner.clj#L55
Andy
On Tue, Sep 17, 2013 at 5:16 PM, Andy Fingerhut
The double-colon is only shorthand for the current namespace:
Or other namespaces via an alias:
(alias 'clj 'clojure.core)
::clj/foo = :clojure.core/foo
Inside ns forms, the :as keyword creates aliases.
--
--
You received this message because you are subscribed to the Google
Groups Clojure
Cool. You learn something new every day :)
On Tuesday, September 17, 2013, Brandon Bloom wrote:
The double-colon is only shorthand for the current namespace:
Or other namespaces via an alias:
(alias 'clj 'clojure.core)
::clj/foo = :clojure.core/foo
Inside ns forms, the :as keyword