Clojure

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

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: Release 1.2
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None
  • Approval:
    Incomplete

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.

Activity

Hide
Stuart Halloway added a comment -

Patch that throws IllegalArgumentException would be ok for this.

Show
Stuart Halloway added a comment - Patch that throws IllegalArgumentException would be ok for this.
Stuart Halloway made changes -
Field Original Value New Value
Fix Version/s Backlog [ 10035 ]
Approval Vetted
Alexander Redington made changes -
Attachment clj-732.diff [ 10164 ]
Alexander Redington made changes -
Approval Vetted Test
Hide
Stuart Halloway added a comment -

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 ...)?

Show
Stuart Halloway added a comment - 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 made changes -
Approval Test Incomplete
Waiting On richhickey
Rich Hickey made changes -
Status Open [ 1 ] Closed [ 6 ]
Resolution Declined [ 2 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: