Clojure

disj! throws exception when attempting to remove multiple items in one call

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.2, Release 1.3, Release 1.4
  • Fix Version/s: Release 1.5
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

disj! fails whenever called with multiple items to remove:

user=> (-> #{5 10 15 20} transient (disj! 10 15) persistent!)
ClassCastException clojure.lang.PersistentHashSet$TransientHashSet cannot be cast to clojure.lang.IPersistentSet clojure.core/disj (core.clj:1419)

It is a simple one line fix to disj! Clojure source code to correct this.

Activity

Hide
Andy Fingerhut added a comment -

clj-934-transient-disj-patch2.txt fixes a problem with my previous one where it had a warning during testing because of a poorly named test that conflicted with a name in clojure.core. This one is clean.

Show
Andy Fingerhut added a comment - clj-934-transient-disj-patch2.txt fixes a problem with my previous one where it had a warning during testing because of a poorly named test that conflicted with a name in clojure.core. This one is clean.
Hide
Stuart Halloway added a comment -

Patch 3 is same as patch 2, but nonreflective invocation.

Show
Stuart Halloway added a comment - Patch 3 is same as patch 2, but nonreflective invocation.
Hide
Andy Fingerhut added a comment -

Removed older patch in favor of Stuart's improved one clj-934-transient-disj-patch-3.txt dated June 8, 2012.

Show
Andy Fingerhut added a comment - Removed older patch in favor of Stuart's improved one clj-934-transient-disj-patch-3.txt dated June 8, 2012.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: