[Newbies] Anomaly of disappearing element in Bag? (2)

Vaidotas Didžbalis vaidasd at gmail.com
Fri Jul 30 14:06:00 UTC 2010


Sorry for previous post,

Hello,
Item "disappears" in Bag after contents of the item changes. Item is
container with equality and hash is overridden. Is this a Bug?

bag:= Bag with: (val := AKContainer value: 'a').
val value: 'b'.
bag valuesAndCounts includesKey:  val. "false in Trunk,"
set:= Set with: (val := AKContainer value: 'a').
val value: 'b'.
set includes:  val. "true"
dictionary:= Dictionary newFromPairs: {val := AKContainer value: 'a'. 1}.
val value: 'b'.
dictionary includesKey:  val. "true"
All tests fails in Squeak 3.6 and in Dolphin ST. In Trunk fails only the Bag.
If this is not a bug, how can I escape this Anomaly of disappearing element [1]
Thank you
Vaidotas
[1] http://books.google.lt/books?id=W8_Une9cbbgC&pg=PA76&lpg=PA76&dq=anomaly+of+the+disappearing+element+smalltalk&source=bl&ots=oOsY_y8pBc&sig=EDgG-Xblp7q1ib19_YunrgBAweY&hl=en&ei=-6NSTJ-4EtGKOOW__J4O&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBAQ6AEwAA#v=onepage&q=anomaly%20of%20the%20disappearing%20element%20smalltalk&f=false
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AKContainer.st
Type: application/octet-stream
Size: 855 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20100730/67f89b01/AKContainer.obj


More information about the Beginners mailing list