In idealized algorithmic terms, is there an efficiency justification for distinguishing the ':/' and ':/something' cases as the reader does?
Seems like an artifact of the implementation rather than a time or space optimization. Maybe that error is only recognized upon entering the sub-parser for the keyword part after the '/', even though you could recognize and bail as soon as you see ':/'. Or, vice versa, read both cases without throwing. It's bad UX for the canonical reader to silently accept something that other impls reject, but people are more likely to blame the alt impl. The more important invariant for reader/writer impls is round-tripping. I'm curious what the writer writes when the reader has read ':/' On Thu, Oct 22, 2020, 07:21 'EuAndreh' via Clojure <clojure@googlegroups.com> wrote: > James Reeves <weavejes...@gmail.com> writes: > > > Where in the specification does it say that the edn reader should throw > > exceptions on errors? > > Well, it doesn't. I think had this expectation of forbidden things > throwing exceptions from some forbidden things throwing exceptions, and > some not doing so. > > Both ":/" and ":/anything" are said to be "not legal keyword", and the > latter does throw and exception while the former doesn't. > > Since "legal" isn't really defined, I indeed can't jump from "it is not > legal" to "it should throw an exception". > > In fact, the spec doesn't even mention exceptions. > > -- > 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. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clojure/875z72e5tw.fsf%40euandre.org. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CABRbBKEGkuNCT0YGZv%2BRg_EVtmTgHFRJtqOWcezOPZnTVirYOA%40mail.gmail.com.