[Cuis] Dictionary asSet

Casey Ransberger casey.obrien.r at gmail.com
Mon Mar 2 00:04:11 CST 2015


I'm pretty sure I said something like "forget what I think, look at what everyone else does." :)

Hard not to think of a dictionary as anything but a set of associations, but I'm quite sure there are perfectly practical reasons for the existing thingie.

Has anybody tried that test out? On stupid phone again...

Anyway I don't think we should worry about what we call the superclass unless it affects compat with some wanted code. Even then, a little shim in the compat package could make up for the difference, no?

--C

> On Mar 1, 2015, at 11:06 AM, Juan Vuletich <juan at jvuletich.org> wrote:
> 
> In Squeak, 'someDictionary asSet' answers a set with the values. It should do the same in Cuis, (like Dan and Nicolas want). Maybe we'd     also adopt the idea of having HashedCollection as a superclass of both Dictionary and Set, just like in Squeak.
> 
> Any takers?
> 
> Cheers,
> Juan Vuletich
> 
>> On 3/1/2015 11:06 AM, Nicolas Cellier wrote:
>> 
>> 
>> 2015-03-01 10:52 GMT+01:00 Casey Ransberger <casey.obrien.r at gmail.com>:
>>> I think it should probably answer a set of associations, specifically, and also have a gut feeling that doing so should be relatively cheap. But don't worry so much about what I think. Look at what the other dialects do, consult book blue, etc...
>> 
>> Please, no.
>> A Dictionary behaves as a Collection of values,  it's just that it has special keys for indexing its contents.
>> Why should asSet do something different than asArray for example?
>> If we want a set of associations, we can just write aDictionary associations asSet.
>> 
>> Nicolas
>> 
>>> Annoying Casey behavior: can you think of an SUnit test that confirms the bug? I'm not just asking you for a test case, not necessarily, but it would be good                   to define expected behavior in a way that allows us later to know that it has changed inadvertently if it does.
>>> 
>>> The test is more important than the fix, if the code is to be the curriculum. 
>>> 
>>> --C
>>> 
>>> On Feb 28, 2015, at 6:45 PM, "Dan Norton" <dnorton at mindspring.com> wrote:
>>> 
>>>> aDictionary asSet should answer a set. Instead, it answers itself (a dictionary).
>>>> 
>>>> I tried to create a new issue but the "Submit new issue" button was disabled.
>>>> _______________________________________________
>>>> Cuis mailing list
>>>> Cuis at jvuletich.org
>>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>> 
>>> _______________________________________________
>>> Cuis mailing list
>>> Cuis at jvuletich.org
>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>> 
>> 
>> _______________________________________________
>> Cuis mailing list
>> Cuis at jvuletich.org
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
> 
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20150301/fc2adc55/attachment-0004.html>


More information about the Cuis mailing list