(keyword "@type") can be printed, but not read

Description

user=> (keyword "")
:
user=> (prn-str *1)
":\n"
user=> (read-string *1)
java.lang.RuntimeException: java.lang.Exception: Invalid token: : (NO_SOURCE_FILE:0)

This obviously isn't a huge defect, but I'd argue that anything that can be printed should be readable.

Environment

None

Activity

Show:

import August 26, 2016 at 1:49 PM

Comment made by: shmish111

Thank you for the explanation, this can therefor be closed.

Alex Miller August 26, 2016 at 1:47 PM

This is a feature used by a lot of Clojure programs. See:

http://clojure.org/guides/faq#unreadable_keywords

import August 26, 2016 at 11:02 AM

Comment made by: shmish111

This is a clone of http://dev.clojure.org/jira/browse/CLJ-732 which it appears was closed with no explanation. I have recently come up against this when deserializing json. IMO it doesn't make sense for the keyword function to be able to produce non-valid keywords. What is the reason for rejecting this?

Declined

Details

Assignee

Reporter

Approval

Incomplete

Priority

Affects versions

Fix versions

Created August 26, 2016 at 11:00 AM
Updated August 26, 2016 at 1:54 PM
Resolved August 26, 2016 at 1:54 PM