(keyword "") 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

Attachments

1
  • 25 Mar 2011, 09:53 PM

Activity

Show:

import August 26, 2016 at 11:03 AM

Comment made by: shmish111

I have cloned this at http://dev.clojure.org/jira/browse/CLJ-2014 as I came up against this problem. It was quite hard to track down.

Stuart Halloway April 6, 2011 at 2:57 AM

After a brief review of places that call intern, it appears that this problem might never be reached in the reader, only in user code calling (keyword ...). Does it make more sense to have the patch there, and a matching change for (symbol ...)?

Stuart Halloway January 28, 2011 at 3:06 PM

Patch that throws IllegalArgumentException would be ok for this.

Declined

Details

Assignee

Reporter

Approval

Incomplete

Priority

Affects versions

Fix versions

Created January 26, 2011 at 11:45 PM
Updated August 26, 2016 at 11:03 AM
Resolved August 26, 2016 at 11:03 AM