The first statement concers the Clojure *reader*, which parses source code 
according to the rules specified in the link provided. What I think the 
first quote refers to, is that all tokens that begin with a ':' will be 
parsed by the reader as Clojure keywords and not symbols. Additionally a 
colon at the end of a token is indicated as invalid so it should result in 
an error.

Here are the three cases that I can make out form the documentation, tried 
at the Clojure REPL:

*user=>* ':with-colon
:with-colon
*user=>* (class ':with-colon)
clojure.lang.Keyword
*user=>* 'sym:bol
sym:bol
*user=>* (class 'sym:bol)
clojure.lang.Symbol
*user=>* 'symbol:
RuntimeException Invalid token: symbol:  clojure.lang.Util.runtimeException 
(Util.java:170)

The document on the second link states at the beggining that* "A superset 
of edn is used by Clojure to represent programs"*,so it would make sense 
that edn takes into account the usage of ':' in symbol names.

I don't think it's an inconsistency since it doesn't concern the reader, 
but the *symbol* function that takes a string and returns a *
clojure.lang.Symbol* doesn't seem to have any issues with the trailing 
colon or other read-invalid symbols, you can basically throw any string to 
it and it'll return a *clojure.lang.Symbol*.

*user=>* (symbol "symbol:")
symbol:
*user=>* (class (symbol ":symbol"))
clojure.lang.Symbol

Hope it helps,

Juan

On Sunday, February 24, 2013 9:13:13 PM UTC-3, Alexander Krasnukhin wrote:
>
> Hi,
>
> I'm confused. Why there two different statements about ':' in symbols? 
> What do I miss?
>
> 1. http://clojure.org/reader
> "Symbols beginning or ending with ':' are reserved by Clojure."
>
> 2. https://github.com/edn-format/edn/blob/master/README.md
> "Additionally, : # are allowed as constituent characters in symbols other 
> than as the first character."
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to