Re: The Trunk: Kernel-nice.277.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-nice.277.mcz

radoslav hodnicak

What's the motivation behind this change? I just traced this as the reason
for my seaside image stopping serving its library files, since a method
there gets a list of selectors and then tries to remove some of them
(which doesn't work for an array).

rado


On Tue, 20 Oct 2009, [hidden email] wrote:

> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-nice.277.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-nice.277
> Author: nice
> Time: 20 October 2009, 11:28:51 am
> UUID: d887faef-c132-4cfc-98e2-259162e0cd01
> Ancestors: Kernel-nice.276
>
> remove #keys and let super return an Array rather than an IdentitySet
>
> =============== Diff against Kernel-nice.276 ===============
>
> Item was removed:
> - ----- Method: MethodDictionary>>keys (in category 'accessing') -----
> - keys
> - "Since method all method selectors are symbols it is more efficient
> - to use an IdentitySet rather than a Set."
> - | aSet |
> - aSet := IdentitySet new: self size.
> - self keysDo: [:key | aSet add: key].
> - ^ aSet!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-nice.277.mcz

Nicolas Cellier
See the thread starting at
http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140239.html

I zealously refactored #selectors also, and that is controversial, see
thread starting at
http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140383.html

In the interim put asSet in #selectors or in Seaside.

Anyway, there should be a place where to put release notes, expecially
when a change might break some compatibility.

Nicolas

2009/10/30 radoslav hodnicak <[hidden email]>:

>
> What's the motivation behind this change? I just traced this as the reason
> for my seaside image stopping serving its library files, since a method
> there gets a list of selectors and then tries to remove some of them (which
> doesn't work for an array).
>
> rado
>
>
> On Tue, 20 Oct 2009, [hidden email] wrote:
>
>> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-nice.277.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-nice.277
>> Author: nice
>> Time: 20 October 2009, 11:28:51 am
>> UUID: d887faef-c132-4cfc-98e2-259162e0cd01
>> Ancestors: Kernel-nice.276
>>
>> remove #keys and let super return an Array rather than an IdentitySet
>>
>> =============== Diff against Kernel-nice.276 ===============
>>
>> Item was removed:
>> - ----- Method: MethodDictionary>>keys (in category 'accessing') -----
>> - keys
>> -       "Since method all method selectors are symbols it is more
>> efficient
>> -       to use an IdentitySet rather than a Set."
>> -       | aSet |
>> -       aSet := IdentitySet new: self size.
>> -       self keysDo: [:key | aSet add: key].
>> -       ^ aSet!
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-nice.277.mcz

Nicolas Cellier
If the problem is located in:

WAFileLibrary>>fileSelectors
        ^ (self class selectors
                select: [ :each | self isFileSelector: each ])
                removeAllFoundIn: self nonFileSelectors;
                yourself

I suggest replacing #removeAllFoundIn: with #copyWithoutAll: (and
remove #yourself)

I did not find other issue after a fast review of #selectors usage in
Seaside2.8.

WATagBrush class>>tag
        ^(self selectors includes: #tag) snip...
should better be written
        ^(self includesSelector: #tag) snip...

Nicolas

2009/10/30 Nicolas Cellier <[hidden email]>:

> See the thread starting at
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140239.html
>
> I zealously refactored #selectors also, and that is controversial, see
> thread starting at
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140383.html
>
> In the interim put asSet in #selectors or in Seaside.
>
> Anyway, there should be a place where to put release notes, expecially
> when a change might break some compatibility.
>
> Nicolas
>
> 2009/10/30 radoslav hodnicak <[hidden email]>:
>>
>> What's the motivation behind this change? I just traced this as the reason
>> for my seaside image stopping serving its library files, since a method
>> there gets a list of selectors and then tries to remove some of them (which
>> doesn't work for an array).
>>
>> rado
>>
>>
>> On Tue, 20 Oct 2009, [hidden email] wrote:
>>
>>> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
>>> http://source.squeak.org/trunk/Kernel-nice.277.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Kernel-nice.277
>>> Author: nice
>>> Time: 20 October 2009, 11:28:51 am
>>> UUID: d887faef-c132-4cfc-98e2-259162e0cd01
>>> Ancestors: Kernel-nice.276
>>>
>>> remove #keys and let super return an Array rather than an IdentitySet
>>>
>>> =============== Diff against Kernel-nice.276 ===============
>>>
>>> Item was removed:
>>> - ----- Method: MethodDictionary>>keys (in category 'accessing') -----
>>> - keys
>>> -       "Since method all method selectors are symbols it is more
>>> efficient
>>> -       to use an IdentitySet rather than a Set."
>>> -       | aSet |
>>> -       aSet := IdentitySet new: self size.
>>> -       self keysDo: [:key | aSet add: key].
>>> -       ^ aSet!
>>>
>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-nice.277.mcz

Igor Stasenko
2009/10/30 Nicolas Cellier <[hidden email]>:

> If the problem is located in:
>
> WAFileLibrary>>fileSelectors
>        ^ (self class selectors
>                select: [ :each | self isFileSelector: each ])
>                removeAllFoundIn: self nonFileSelectors;
>                yourself
>
> I suggest replacing #removeAllFoundIn: with #copyWithoutAll: (and
> remove #yourself)
>
.. and even if you insist of using #selectors , you can always use
#reject: or #select:
to filter the result instead of using a low-level #remove:

> I did not find other issue after a fast review of #selectors usage in
> Seaside2.8.
>
> WATagBrush class>>tag
>        ^(self selectors includes: #tag) snip...
> should better be written
>        ^(self includesSelector: #tag) snip...
>
> Nicolas
>
> 2009/10/30 Nicolas Cellier <[hidden email]>:
>> See the thread starting at
>> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140239.html
>>
>> I zealously refactored #selectors also, and that is controversial, see
>> thread starting at
>> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140383.html
>>
>> In the interim put asSet in #selectors or in Seaside.
>>
>> Anyway, there should be a place where to put release notes, expecially
>> when a change might break some compatibility.
>>
>> Nicolas
>>
>> 2009/10/30 radoslav hodnicak <[hidden email]>:
>>>
>>> What's the motivation behind this change? I just traced this as the reason
>>> for my seaside image stopping serving its library files, since a method
>>> there gets a list of selectors and then tries to remove some of them (which
>>> doesn't work for an array).
>>>
>>> rado
>>>
>>>
>>> On Tue, 20 Oct 2009, [hidden email] wrote:
>>>
>>>> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
>>>> http://source.squeak.org/trunk/Kernel-nice.277.mcz
>>>>
>>>> ==================== Summary ====================
>>>>
>>>> Name: Kernel-nice.277
>>>> Author: nice
>>>> Time: 20 October 2009, 11:28:51 am
>>>> UUID: d887faef-c132-4cfc-98e2-259162e0cd01
>>>> Ancestors: Kernel-nice.276
>>>>
>>>> remove #keys and let super return an Array rather than an IdentitySet
>>>>
>>>> =============== Diff against Kernel-nice.276 ===============
>>>>
>>>> Item was removed:
>>>> - ----- Method: MethodDictionary>>keys (in category 'accessing') -----
>>>> - keys
>>>> -       "Since method all method selectors are symbols it is more
>>>> efficient
>>>> -       to use an IdentitySet rather than a Set."
>>>> -       | aSet |
>>>> -       aSet := IdentitySet new: self size.
>>>> -       self keysDo: [:key | aSet add: key].
>>>> -       ^ aSet!
>>>>
>>>>
>>>
>>>
>>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-nice.277.mcz

radoslav hodnicak
In reply to this post by Nicolas Cellier

ok thanks. as for warnings about changes that might break compatibility,
maybe a non-blocking window when loading the package?

rado

On Fri, 30 Oct 2009, Nicolas Cellier wrote:

> See the thread starting at
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140239.html
>
> I zealously refactored #selectors also, and that is controversial, see
> thread starting at
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-October/140383.html
>
> In the interim put asSet in #selectors or in Seaside.
>
> Anyway, there should be a place where to put release notes, expecially
> when a change might break some compatibility.
>
> Nicolas
>
> 2009/10/30 radoslav hodnicak <[hidden email]>:
>>
>> What's the motivation behind this change? I just traced this as the reason
>> for my seaside image stopping serving its library files, since a method
>> there gets a list of selectors and then tries to remove some of them (which
>> doesn't work for an array).
>>
>> rado
>>
>>
>> On Tue, 20 Oct 2009, [hidden email] wrote:
>>
>>> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
>>> http://source.squeak.org/trunk/Kernel-nice.277.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Kernel-nice.277
>>> Author: nice
>>> Time: 20 October 2009, 11:28:51 am
>>> UUID: d887faef-c132-4cfc-98e2-259162e0cd01
>>> Ancestors: Kernel-nice.276
>>>
>>> remove #keys and let super return an Array rather than an IdentitySet
>>>
>>> =============== Diff against Kernel-nice.276 ===============
>>>
>>> Item was removed:
>>> - ----- Method: MethodDictionary>>keys (in category 'accessing') -----
>>> - keys
>>> -       "Since method all method selectors are symbols it is more
>>> efficient
>>> -       to use an IdentitySet rather than a Set."
>>> -       | aSet |
>>> -       aSet := IdentitySet new: self size.
>>> -       self keysDo: [:key | aSet add: key].
>>> -       ^ aSet!
>>>
>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-nice.277.mcz

Bert Freudenberg
In reply to this post by Igor Stasenko

On 30.10.2009, at 13:58, Igor Stasenko wrote:

> 2009/10/30 Nicolas Cellier <[hidden email]>:
>> If the problem is located in:
>>
>> WAFileLibrary>>fileSelectors
>>        ^ (self class selectors
>>                select: [ :each | self isFileSelector: each ])
>>                removeAllFoundIn: self nonFileSelectors;
>>                yourself
>>
>> I suggest replacing #removeAllFoundIn: with #copyWithoutAll: (and
>> remove #yourself)
>>
> .. and even if you insist of using #selectors , you can always use
> #reject: or #select:
> to filter the result instead of using a low-level #remove:

I thought we agreed that #selectors should continue to answer a Set?

- Bert -