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.
Andy Fingerhut made changes -
Field Original Value New Value
Attachment clj-934-transient-disj-patch2.txt [ 10987 ]
Andy Fingerhut made changes -
Attachment transient-disj-patch1.txt [ 10936 ]
Rich Hickey made changes -
Fix Version/s Release 1.5 [ 10150 ]
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.
Stuart Halloway made changes -
Approval Screened [ 10004 ]
Attachment clj-934-transient-disj-patch-3.txt [ 11300 ]
Andy Fingerhut made changes -
Attachment clj-934-transient-disj-patch2.txt [ 10987 ]
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.
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: