On Thursday, March 1, 2018 at 9:34:29 AM UTC-6, Thomas Heller wrote:
> Clojure follows the principle of "Garbage in, Garbage out" for a lot of 
> internal functions. 

I would say "unspecified input / unspecified output", however this is not 
one of those cases in my opinion. The keyword function creates keywords and 
they can be programatically used just fine. You can put them in a map, use 
them as accessors, etc. 

> Meaning you are responsible for ensuring that you only use valid data when 
> calling those functions as the validation itself carries overhead which the 
> core fns should not have.
> :a/0 fails because the reader does those checks and fails. The keyword fn 
> does no checks and lets you have your invalid keywords. They are still 
> invalid keywords though. Keywords are not allowed to start with numbers.

Really, that applies specifically to *literal* keywords (and actually even 
that is a matter of some lengthy debate and differences between clj and 
cljs). They are still valid keyword instances, just not ones that can be 
printed and read back by the reader.

> https://github.com/edn-format/edn might be a helpful reference about that 
> is allowed and what isn't.

Clojure(Script) code is not edn so the reader page is a better reference 
- https://clojure.org/reference/reader

These pages will not agree exactly - edn tends to be more restrictive in 
what it officially supports.

Note that posts from new members are moderated - please be patient with your 
first post.
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to