Details
-
Type:
Defect
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
-
Approval:Vetted
Description
The LispReader tries to read a record instead of a literal if the tag contains periods:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L1171
Which effectively means that reader tags cannot contain periods.
The EDN spec is unclear on this:
edn supports extensibility through a simple mechanism. # followed immediately by a symbol starting with an alphabetic character indicates that that symbol is a tag.
(issue opened: https://github.com/edn-format/edn/issues/39)
If periods are allowed, then the LispReader should first check to see if the tag is in *data-readers* and only then if not try to initialize a Java class.
I'm happy to write the patch if this behavior is what is desired.
Kevin, I'm not planning to work on this right now as 1.5 is pretty much done. It might be worthwhile discussing the issue a bit on the dev mailing list before working on a patch, but that's up to you. I think my approach was correct, although now changes would have to be applied to both LispReader and EdnReader.