This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-02
Channels
- # announcements (4)
- # aws (18)
- # beginners (227)
- # boot (1)
- # calva (13)
- # cider (22)
- # clara (2)
- # cljs-dev (17)
- # clojure (85)
- # clojure-brasil (2)
- # clojure-dev (55)
- # clojure-europe (2)
- # clojure-italy (18)
- # clojure-japan (4)
- # clojure-losangeles (1)
- # clojure-nl (5)
- # clojure-uk (53)
- # clojurescript (46)
- # clojureverse-ops (8)
- # cursive (17)
- # data-science (3)
- # datascript (3)
- # datomic (25)
- # duct (4)
- # emacs (2)
- # figwheel-main (1)
- # fulcro (9)
- # hoplon (2)
- # hyperfiddle (1)
- # jobs-discuss (5)
- # kaocha (7)
- # leiningen (3)
- # nrepl (50)
- # off-topic (32)
- # portland-or (1)
- # re-frame (19)
- # reitit (2)
- # shadow-cljs (30)
- # spacemacs (2)
- # sql (8)
- # tools-deps (4)
- # vim (26)
- # xtdb (3)
- # yada (8)
Proposal: read single characters of :
as whitespace, ala ,
, so that json files can be directly read into Clojure maps, without having to clean the colons out.
there actually is a very old proposal for this in jira
I'd say at this point that it's unlikely we're ever going to do this
hmmm, a lot of "boo" votes on that ticket... Thanks for the context, @alexmiller
I think if you look at the details, there are a lot of subtle points about reader ambiguity being made that are well-founded
Very nicely written, Alex https://clojure.org/community/contributing
thx, still needs some review from Rich and Stu so might go through some changes :)
lol and some not so subtle 😉 I don't know, I don't find them very convincing. JSON keys are strings, so I don't think you'd have such ambiguity.
But it seems like adding another white space char would be perceived as extra "pollution" to the syntax.
because come to think of it, the only place I have every seen it done is actually in js
Anyway, even if they did accept unquoted keys, I still don't think that'd be a sufficient objection on it's own. If some json accidentally has unquoted keys with colons beside them, with no space between them, you'd get a symbol with a colon at the end.
I do wonder though if the extra logic branch to accept and then ignore :
would slow down reads on keywords at all
automatically turning json string keys in to keywords instead of leaving them as strings would be another thing
Well, this would imply that you could read a syntactically correct JSON map and the reader wouldn't even know it's not a map already
you just said "I do wonder though if the extra logic branch to accept and then ignore :
would slow down reads on keywords at all"
the reader is not a parser combinator thing where you can read and fail and try something else
I don't know if anyone is keeping a formal analysis, but the reader is, if I recall generally LL(1)
{"a":true}
seems to be the killer counter-argument to this whole discussion.
It's right there in the ticket.
Well, yeah, but I wanted to lead with a well-defined, valid keyword example 🙂 :123
works but... 🙂
Feel free to delete all your messages above (and we'll delete ours) 🙂
It doesn't. It just makes them unsearchable. If we paid for a month, they'd all still be there.
Mind you, at this point, they're all enshrined in the ClojureVerse log archive and in Zulip's infinite searchable archive 🙃
I'll just suffice to apologize for all the noise in the dev channel. Interesting thoughts though. Thanks folks.
no worries