Hey All, The collect: on IdentitySet returns Set. Is this really wanted behaviour or is it a bug? For example: set := IdentitySet with: 'foo' with: 'bar'. newSet := set collect: [:e | #size -> e size ]. This two assertions do not pass: self assert: newSet size == 2. self assert: newSet class == IdentitySet Surprisingly (for me), if I change the implementation of collect: to use self species new instead of: Set new, the Pharo becomes really unresponsive... Cheers, Jan
2015-07-20 22:11 GMT+02:00 Jan Kurš <kurs@iam.unibe.ch>:
Hey All,
The collect: on IdentitySet returns Set. Is this really wanted behaviour or is it a bug?
There was a long discussion about this http://forum.world.st/IdentitySet-collect-tp4792384.html and I thought this was fixed issue 14535
For example:
set := IdentitySet with: 'foo' with: 'bar'. newSet := set collect: [:e | #size -> e size ].
This two assertions do not pass: self assert: newSet size == 2. self assert: newSet class == IdentitySet
Surprisingly (for me), if I change the implementation of collect: to use self species new instead of: Set new, the Pharo becomes really unresponsive...
Cheers, Jan
On 20 Jul 2015, at 22:42, Nicolai Hess <nicolaihess@web.de> wrote:
2015-07-20 22:11 GMT+02:00 Jan Kurš <kurs@iam.unibe.ch <mailto:kurs@iam.unibe.ch>>: Hey All,
The collect: on IdentitySet returns Set. Is this really wanted behaviour or is it a bug?
There was a long discussion about this http://forum.world.st/IdentitySet-collect-tp4792384.html <http://forum.world.st/IdentitySet-collect-tp4792384.html> and I thought this was fixed issue 14535
I guess only in Pharo5. We can back port if someone takes the lead. Marcus
Oh, I can confirm, the behaviour in Pharo5 is OK. In Pharo4, as I described. It is not a big deal for me, I just wanted to ask about it... Cheers, Jan On Tue, Jul 21, 2015 at 7:59 AM Marcus Denker <marcus.denker@inria.fr> wrote:
On 20 Jul 2015, at 22:42, Nicolai Hess <nicolaihess@web.de> wrote:
2015-07-20 22:11 GMT+02:00 Jan Kurš <kurs@iam.unibe.ch>:
Hey All,
The collect: on IdentitySet returns Set. Is this really wanted behaviour or is it a bug?
There was a long discussion about this http://forum.world.st/IdentitySet-collect-tp4792384.html and I thought this was fixed issue 14535
I guess only in Pharo5. We can back port if someone takes the lead.
Marcus
participants (3)
-
Jan Kurš -
Marcus Denker -
Nicolai Hess