Clojure

LazySeq switches to equiv when using equals

Details

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

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

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

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: