Welcome! Please see the About page for a little more info on how this works.

0 votes
in test.check by

The Clojure and Clojure reader both accept :/ as a keyword, and test.check generates it. From what I could gather from conversations on Slack however it does not seem to be officially considered valid. For example in this thread, which mentions there was an earlier discussion in clojure-dev, but unfortunately I was not able to find it.

It was suggested to remove it from test.check (TCHECK-155) which was closed with a call to authority and quote from Alex Miller, however Alex has also stated that he considers this a test.check bug.

The quote in TCHECK-155 also mentions that "clojurescript should fix its weirdness", but I could not find the original conversation so I'm not sure what this refers to or if there's a ticket. I did find that clojurescript behaves differently than clojure in at least one way

(name (keyword "/")) ;;clj => "" ;;cljs => "/"

I guess my question is, is :/ considered a) valid, b) invalid, or c) undefined / left for future expansion, in EDN and/or in Clojure?

If it is a) valid, is it then safe to say that (name (keyword "/")) is a clojurescript bug?

If it is b) or c), does that mean that TCHECK-155 should be reopened?

Thanks!

2 Answers

0 votes
by

This is what I found when looking into this for tree-sitter-clojure: https://clojurians-log.clojureverse.org/clojure-dev/2019-06-07

alexmiller13:06:13

@gfredericks :/ is "open for the language to start interpreting" and not an invalid keyword so should be ok to generate. and cljs should fix it's weirdness.

by
Thank you! That conversation really clarifies a lot.
0 votes
by

It is undefined/left for future expansion.

Clojurescript's reading seems weird but given that this is undefined it's hard to say it's wrong. :)

Re test.check, is this an issue for you? I don't personally have any strong feelings about it but if it's making life hard for people, seems reasonable to not gen these.

by
yeah I ran into it specifically because of the different clojurescript behavior, when doing property based testing on cross-platform code.
by
Fine by me to reopen it
by
I commented on [TCHECK-155](https://clojure.atlassian.net/browse/TCHECK-155), but I feel it's not my position to formally reopen it.
by
Changed and released in tools.check 1.1.0
by
Thank you! <3
...