Should refactoring cope with symbols in Pharo or should we avoid symbols?

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

Should refactoring cope with symbols in Pharo or should we avoid symbols?

Tim Mackinnon
I logged issue http://code.google.com/p/pharo/issues/detail?id=2817 
where I noted that code using a symbol like the following example
doesn't get refactored in pharo (e.g. changing the modelChanged method
doesn't change this code):

model announcer subscribe: ElephantModelChanged send: #modelChanged to: self

I was surprised by this as in Dolphin it works - and I never thought
twice about it - to me, symbol = selector. Renaming a method, or adding
a parameter to a method would also affect matching symbols.

So I guess my wider question is, should I simply never use symbols in
Pharo?

Tim


_______________________________________________
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: Should refactoring cope with symbols in Pharo or should we avoid symbols?

Simon Denier-3

On 30 sept. 2010, at 14:34, TimM wrote:

> I logged issue http://code.google.com/p/pharo/issues/detail?id=2817 where I noted that code using a symbol like the following example doesn't get refactored in pharo (e.g. changing the modelChanged method doesn't change this code):
>
> model announcer subscribe: ElephantModelChanged send: #modelChanged to: self
>
> I was surprised by this as in Dolphin it works - and I never thought twice about it - to me, symbol = selector. Renaming a method, or adding a parameter to a method would also affect matching symbols.
>
> So I guess my wider question is, should I simply never use symbols in Pharo?



We have plenty of use for symbols as selectors in Moose/Mondrian/Glamour, so yes I concur with the issue.


--
 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: Should refactoring cope with symbols in Pharo or should we avoid symbols?

Tudor Girba
Me too :)

Doru


On 30 Sep 2010, at 14:53, Simon Denier wrote:

>
> On 30 sept. 2010, at 14:34, TimM wrote:
>
>> I logged issue http://code.google.com/p/pharo/issues/detail?id=2817 where I noted that code using a symbol like the following example doesn't get refactored in pharo (e.g. changing the modelChanged method doesn't change this code):
>>
>> model announcer subscribe: ElephantModelChanged send: #modelChanged to: self
>>
>> I was surprised by this as in Dolphin it works - and I never thought twice about it - to me, symbol = selector. Renaming a method, or adding a parameter to a method would also affect matching symbols.
>>
>> So I guess my wider question is, should I simply never use symbols in Pharo?
>
>
>
> We have plenty of use for symbols as selectors in Moose/Mondrian/Glamour, so yes I concur with the issue.
>
>
> --
> Simon
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
www.tudorgirba.com

"Next time you see your life passing by, say 'hi' and get to know her."




_______________________________________________
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: Should refactoring cope with symbols in Pharo or should we avoid symbols?

Lukas Renggli
In reply to this post by Tim Mackinnon
On 30 September 2010 14:33, TimM <[hidden email]> wrote:

> I logged issue http://code.google.com/p/pharo/issues/detail?id=2817 where I
> noted that code using a symbol like the following example doesn't get
> refactored in pharo (e.g. changing the modelChanged method doesn't change
> this code):
>
> model announcer subscribe: ElephantModelChanged send: #modelChanged to: self
>
> I was surprised by this as in Dolphin it works - and I never thought twice
> about it - to me, symbol = selector. Renaming a method, or adding a
> parameter to a method would also affect matching symbols.

Renaming a method also changes all the symbols in my image.

Adding or reordering parameters however does not touch the symbols. I
remember having read an explanation of John/Don that they explicitly
decided not to do so, because it would also require to rewrite
#perform: and similar methods that are not known.

Lukas

--
Lukas Renggli
www.lukas-renggli.ch

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