Clojure

read+string does not support reader conditionals

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.10
  • Fix Version/s: None
  • Component/s: None
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

Because read+string calls downwards with (apply read rdr args) it does not support reader conditionals. Those have to be flagged in through the opts parameter to #'read, which is only available with the oddly backwards signature (read opts rdr)

Proposed: Need to handle the different arities of read+string appropriately so that all of them forward correctly to read (in particular the [opts stream] one).

Patch: clj-2358.patch

Activity

Hide
Nicola Mometto added a comment -

Here's the implementation of tools.reader, which doesn't contain this bug: https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj#L1013-L1015
Something similar could be done here, or read+string could be manually unrolled

Show
Nicola Mometto added a comment - Here's the implementation of tools.reader, which doesn't contain this bug: https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj#L1013-L1015 Something similar could be done here, or read+string could be manually unrolled
Hide
Ghadi Shayban added a comment -

read+string doesn't reach the underlying (read opts stream) signature at all, so whatever missing opts are not limited to reader conditionals

Show
Ghadi Shayban added a comment - read+string doesn't reach the underlying (read opts stream) signature at all, so whatever missing opts are not limited to reader conditionals

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: