MethodDictionary >> #do: deprecated

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

MethodDictionary >> #do: deprecated

Romain Robbes
Each time methodDictionary >> #do: is invoked, I get a warning.
Worse, if warnings are disabled, it will not do anything, which sounds  
error-prone.

Why not just removing the method and use the implementation in  
Dictionary?

        Romain

--
Romain Robbes
http://www.inf.unisi.ch/phd/robbes


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Stéphane Ducasse
in which image?

Stef

On May 28, 2009, at 10:48 AM, Romain Robbes wrote:

> Each time methodDictionary >> #do: is invoked, I get a warning.
> Worse, if warnings are disabled, it will not do anything, which sounds
> error-prone.
>
> Why not just removing the method and use the implementation in
> Dictionary?
>
> Romain
>
> --
> Romain Robbes
> http://www.inf.unisi.ch/phd/robbes
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Romain Robbes
in Pharo 10318

On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:

> in which image?
>
> Stef
>
> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>
>> Each time methodDictionary >> #do: is invoked, I get a warning.
>> Worse, if warnings are disabled, it will not do anything, which  
>> sounds
>> error-prone.
>>
>> Why not just removing the method and use the implementation in
>> Dictionary?
>>
>> Romain
>>
>> --
>> Romain Robbes
>> http://www.inf.unisi.ch/phd/robbes
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
Romain Robbes
http://www.inf.unisi.ch/phd/robbes


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Simon Denier-3

Well, the previous implementation of MethodDictionary#do:  (non-
licence clean) looks like an optimization with some nil check. So far  
I didnt have any problem running with replacement code, and the super  
implementation in Dictionary should work fine too.

Does someone know when/why nil values could be stored in a method  
dictionary?

On 28 mai 09, at 11:25, Romain Robbes wrote:

> in Pharo 10318
>
> On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:
>
>> in which image?
>>
>> Stef
>>
>> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>>
>>> Each time methodDictionary >> #do: is invoked, I get a warning.
>>> Worse, if warnings are disabled, it will not do anything, which
>>> sounds
>>> error-prone.
>>>
>>> Why not just removing the method and use the implementation in
>>> Dictionary?
>>>
>>> Romain
>>>
>>> --
>>> Romain Robbes
>>> http://www.inf.unisi.ch/phd/robbes
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> Romain Robbes
> http://www.inf.unisi.ch/phd/robbes
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

--
  Simon




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Romain Robbes


On May 28, 2009, at 11:37 AM, Simon Denier wrote:

>
> Well, the previous implementation of MethodDictionary#do:  (non-
> licence clean) looks like an optimization with some nil check. So far
> I didnt have any problem running with replacement code, and the super
> implementation in Dictionary should work fine too.
>
> Does someone know when/why nil values could be stored in a method
> dictionary?
>

Maybe as a side effect of removing a method from the system?

        Romain

> On 28 mai 09, at 11:25, Romain Robbes wrote:
>
>> in Pharo 10318
>>
>> On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:
>>
>>> in which image?
>>>
>>> Stef
>>>
>>> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>>>
>>>> Each time methodDictionary >> #do: is invoked, I get a warning.
>>>> Worse, if warnings are disabled, it will not do anything, which
>>>> sounds
>>>> error-prone.
>>>>
>>>> Why not just removing the method and use the implementation in
>>>> Dictionary?
>>>>
>>>> Romain
>>>>
>>>> --
>>>> Romain Robbes
>>>> http://www.inf.unisi.ch/phd/robbes
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> --
>> Romain Robbes
>> http://www.inf.unisi.ch/phd/robbes
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> --
>  Simon
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
Romain Robbes
http://www.inf.unisi.ch/phd/robbes


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Stéphane Ducasse
In reply to this post by Romain Robbes
I really do not know from where this method is coming from.
Scary. We will have to improve our tracability

Stef

On May 28, 2009, at 11:25 AM, Romain Robbes wrote:

> in Pharo 10318
>
> On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:
>
>> in which image?
>>
>> Stef
>>
>> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>>
>>> Each time methodDictionary >> #do: is invoked, I get a warning.
>>> Worse, if warnings are disabled, it will not do anything, which
>>> sounds
>>> error-prone.
>>>
>>> Why not just removing the method and use the implementation in
>>> Dictionary?
>>>
>>> Romain
>>>
>>> --
>>> Romain Robbes
>>> http://www.inf.unisi.ch/phd/robbes
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> Romain Robbes
> http://www.inf.unisi.ch/phd/robbes
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Adrian Lienhard
I deprecated this method because it was not clean and there were no  
senders in the core.

If this method is used, we should re-implement it.

You cannot just use the super implementation. Method dictionaries  
internally include nil key/values just like Dictionaries do but  
MethodDictionary is implemented differently than Dictionary (its a  
variable subclass and the array contains values whereas the indexable  
part contains the keys).

Adrian

On May 28, 2009, at 12:30 , Stéphane Ducasse wrote:

> I really do not know from where this method is coming from.
> Scary. We will have to improve our tracability
>
> Stef
>
> On May 28, 2009, at 11:25 AM, Romain Robbes wrote:
>
>> in Pharo 10318
>>
>> On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:
>>
>>> in which image?
>>>
>>> Stef
>>>
>>> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>>>
>>>> Each time methodDictionary >> #do: is invoked, I get a warning.
>>>> Worse, if warnings are disabled, it will not do anything, which
>>>> sounds
>>>> error-prone.
>>>>
>>>> Why not just removing the method and use the implementation in
>>>> Dictionary?
>>>>
>>>> Romain
>>>>
>>>> --
>>>> Romain Robbes
>>>> http://www.inf.unisi.ch/phd/robbes
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> --
>> Romain Robbes
>> http://www.inf.unisi.ch/phd/robbes
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Simon Denier-3

On 28 mai 09, at 14:02, Adrian Lienhard wrote:

> I deprecated this method because it was not clean and there were no
> senders in the core.
>
> If this method is used, we should re-implement it.

It is used by Fame/Moose/OCompletion, perhaps some others...
So yes, should be re-implemented

>
>
> You cannot just use the super implementation. Method dictionaries
> internally include nil key/values just like Dictionaries do but
> MethodDictionary is implemented differently than Dictionary (its a
> variable subclass and the array contains values whereas the indexable
> part contains the keys).
>
> Adrian
>
> On May 28, 2009, at 12:30 , Stéphane Ducasse wrote:
>
>> I really do not know from where this method is coming from.
>> Scary. We will have to improve our tracability
>>
>> Stef
>>
>> On May 28, 2009, at 11:25 AM, Romain Robbes wrote:
>>
>>> in Pharo 10318
>>>
>>> On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:
>>>
>>>> in which image?
>>>>
>>>> Stef
>>>>
>>>> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>>>>
>>>>> Each time methodDictionary >> #do: is invoked, I get a warning.
>>>>> Worse, if warnings are disabled, it will not do anything, which
>>>>> sounds
>>>>> error-prone.
>>>>>
>>>>> Why not just removing the method and use the implementation in
>>>>> Dictionary?
>>>>>
>>>>> Romain
>>>>>
>>>>> --
>>>>> Romain Robbes
>>>>> http://www.inf.unisi.ch/phd/robbes
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> [hidden email]
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- 
>>>>> project
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>> --
>>> Romain Robbes
>>> http://www.inf.unisi.ch/phd/robbes
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

--
  Simon




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Romain Robbes
In reply to this post by Adrian Lienhard
maybe just as that?

do: aBlock
        ^ self valuesDo: aBlock

at least if it is deprecated it should not change the behavior.

        Romain


On May 28, 2009, at 2:02 PM, Adrian Lienhard wrote:

> I deprecated this method because it was not clean and there were no
> senders in the core.
>
> If this method is used, we should re-implement it.
>
> You cannot just use the super implementation. Method dictionaries
> internally include nil key/values just like Dictionaries do but
> MethodDictionary is implemented differently than Dictionary (its a
> variable subclass and the array contains values whereas the indexable
> part contains the keys).
>
> Adrian
>
> On May 28, 2009, at 12:30 , Stéphane Ducasse wrote:
>
>> I really do not know from where this method is coming from.
>> Scary. We will have to improve our tracability
>>
>> Stef
>>
>> On May 28, 2009, at 11:25 AM, Romain Robbes wrote:
>>
>>> in Pharo 10318
>>>
>>> On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:
>>>
>>>> in which image?
>>>>
>>>> Stef
>>>>
>>>> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>>>>
>>>>> Each time methodDictionary >> #do: is invoked, I get a warning.
>>>>> Worse, if warnings are disabled, it will not do anything, which
>>>>> sounds
>>>>> error-prone.
>>>>>
>>>>> Why not just removing the method and use the implementation in
>>>>> Dictionary?
>>>>>
>>>>> Romain
>>>>>
>>>>> --
>>>>> Romain Robbes
>>>>> http://www.inf.unisi.ch/phd/robbes
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> [hidden email]
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- 
>>>>> project
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>> --
>>> Romain Robbes
>>> http://www.inf.unisi.ch/phd/robbes
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
Romain Robbes
http://www.inf.unisi.ch/phd/robbes


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MethodDictionary >> #do: deprecated

Adrian Lienhard

On May 28, 2009, at 14:13 , Romain Robbes wrote:

> maybe just as that?
>
> do: aBlock
> ^ self valuesDo: aBlock

yes, looks good.

> at least if it is deprecated it should not change the behavior.

Yes, you are right. The deprecation I did was wrong.

Adrian

>
>
> Romain
>
>
> On May 28, 2009, at 2:02 PM, Adrian Lienhard wrote:
>
>> I deprecated this method because it was not clean and there were no
>> senders in the core.
>>
>> If this method is used, we should re-implement it.
>>
>> You cannot just use the super implementation. Method dictionaries
>> internally include nil key/values just like Dictionaries do but
>> MethodDictionary is implemented differently than Dictionary (its a
>> variable subclass and the array contains values whereas the indexable
>> part contains the keys).
>>
>> Adrian
>>
>> On May 28, 2009, at 12:30 , Stéphane Ducasse wrote:
>>
>>> I really do not know from where this method is coming from.
>>> Scary. We will have to improve our tracability
>>>
>>> Stef
>>>
>>> On May 28, 2009, at 11:25 AM, Romain Robbes wrote:
>>>
>>>> in Pharo 10318
>>>>
>>>> On May 28, 2009, at 11:12 AM, Stéphane Ducasse wrote:
>>>>
>>>>> in which image?
>>>>>
>>>>> Stef
>>>>>
>>>>> On May 28, 2009, at 10:48 AM, Romain Robbes wrote:
>>>>>
>>>>>> Each time methodDictionary >> #do: is invoked, I get a warning.
>>>>>> Worse, if warnings are disabled, it will not do anything, which
>>>>>> sounds
>>>>>> error-prone.
>>>>>>
>>>>>> Why not just removing the method and use the implementation in
>>>>>> Dictionary?
>>>>>>
>>>>>> Romain
>>>>>>
>>>>>> --
>>>>>> Romain Robbes
>>>>>> http://www.inf.unisi.ch/phd/robbes
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Pharo-project mailing list
>>>>>> [hidden email]
>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-
>>>>>> project
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> [hidden email]
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- 
>>>>> project
>>>>
>>>> --
>>>> Romain Robbes
>>>> http://www.inf.unisi.ch/phd/robbes
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> Romain Robbes
> http://www.inf.unisi.ch/phd/robbes
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project