tools.namespace

Wasted call to str in read-ns-decl

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

The function read-ns-decl (both copies in each of two namespaces) contain the expression:

(doto (read rdr) str)

This is equivalent to (read rdr), plus a wasted call to str whose return value is discarded.

Activity

Hide
Stuart Sierra added a comment -

The call to str was added to force the Clojure reader to throw exceptions immediately when it encounters a syntax error. See TNS-1

Show
Stuart Sierra added a comment - The call to str was added to force the Clojure reader to throw exceptions immediately when it encounters a syntax error. See TNS-1
Stuart Sierra made changes -
Field Original Value New Value
Resolution Declined [ 2 ]
Status Open [ 1 ] Resolved [ 5 ]
Hide
Andy Fingerhut added a comment -

Sorry for the noise. I was trying out pre-release version of Eastwood linter on as many contrib libraries as possible, and it found that odd-looking code. It didn't occur to me to look through the commit history to see when it became like it was, and why. Subtle.

Show
Andy Fingerhut added a comment - Sorry for the noise. I was trying out pre-release version of Eastwood linter on as many contrib libraries as possible, and it found that odd-looking code. It didn't occur to me to look through the commit history to see when it became like it was, and why. Subtle.
Hide
Stuart Sierra added a comment -

Mark old resolved issues as 'closed'

Show
Stuart Sierra added a comment - Mark old resolved issues as 'closed'
Stuart Sierra made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: