Clojure

LazySeq switches to equiv when using equals

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.6, Release 1.7
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

When comparing lazy seqs with java equality operator .equals, the implementation switches to the Clojures .equiv comparison. This switch is not present in any other Seq or ordered collection type.

user> (.equals '(3) '(3N))
false
user> (.equals [3] [3N])
false
user> (.equals (seq [3]) (seq [3N]))
false
user> (.equals (lazy-seq [3]) (lazy-seq [3N]))
true

Screened by: Alex Miller

Activity

Hide
Jozef Wagner added a comment -

Patch clj-1501.diff with tests added

Show
Jozef Wagner added a comment - Patch clj-1501.diff with tests added
Hide
Andy Fingerhut added a comment -

This ticket has no Fix Version/s, but is Screened, so at least in some code I have it is 'off the JIRA workflow state diagram'. Not sure if it shows up that way in your filters, Alex.

Show
Andy Fingerhut added a comment - This ticket has no Fix Version/s, but is Screened, so at least in some code I have it is 'off the JIRA workflow state diagram'. Not sure if it shows up that way in your filters, Alex.
Hide
Alex Miller added a comment -

Yup thanks.

Show
Alex Miller added a comment - Yup thanks.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: