Detecting overriding class extensions

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

Detecting overriding class extensions

Simon Denier-3

Does anybody have a tool to detect class extensions which override  
methods? Because that's so bad it's evil.

--
  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: Detecting overriding class extensions

Damien Cassou
On Tue, Oct 20, 2009 at 1:24 PM, Simon Denier <[hidden email]> wrote:
> Does anybody have a tool to detect class extensions which override
> methods? Because that's so bad it's evil.

You can have a look at the following script which basically warns you
if you load a package that overrides a method IIRC.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry

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

WarnsAboutOverride-damiencassou.1.cs (840 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Detecting overriding class extensions

Lukas Renggli
You can also ask the PackageInfo for #overrideMethods.

Lukas

2009/10/20 Damien Cassou <[hidden email]>:

> On Tue, Oct 20, 2009 at 1:24 PM, Simon Denier <[hidden email]> wrote:
>> Does anybody have a tool to detect class extensions which override
>> methods? Because that's so bad it's evil.
>
> You can have a look at the following script which basically warns you
> if you load a package that overrides a method IIRC.
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
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: Detecting overriding class extensions

Simon Denier-3
In reply to this post by Damien Cassou

On 20 oct. 2009, at 13:45, Damien Cassou wrote:

> On Tue, Oct 20, 2009 at 1:24 PM, Simon Denier  
> <[hidden email]> wrote:
>> Does anybody have a tool to detect class extensions which override
>> methods? Because that's so bad it's evil.
>
> You can have a look at the following script which basically warns you
> if you load a package that overrides a method IIRC.


Sorry but I cant see a difference. Can you detail a use case that I  
can reproduce? (because I know there are still a few overrides in  
Moose but can not reproduce)


>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
> <WarnsAboutOverride-damiencassou.
> 1.cs>_______________________________________________
> 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: Detecting overriding class extensions

Simon Denier-3
In reply to this post by Lukas Renggli

On 20 oct. 2009, at 14:16, Lukas Renggli wrote:

> You can also ask the PackageInfo for #overrideMethods.


ahah, interesting but broken, apparently nobody has used it for a long  
time?

First, there is a gross spelling mistake in PackageInfo>>overrideMethods
        ^ self extensionMethods select: [:ea | self isOvverideMethod: ea]

easy enough to correct.

Second, isOverrideMethod: aMethodReference
        ^ aMethodReference category endsWith: '-override'

uses a convention to identify override, but apparently Monticello does  
not follow its own convention anymore.

Does anybody have an idea about what happened?


>
> Lukas
>
> 2009/10/20 Damien Cassou <[hidden email]>:
>> On Tue, Oct 20, 2009 at 1:24 PM, Simon Denier  
>> <[hidden email]> wrote:
>>> Does anybody have a tool to detect class extensions which override
>>> methods? Because that's so bad it's evil.
>>
>> You can have a look at the following script which basically warns you
>> if you load a package that overrides a method IIRC.
>>
>> --
>> Damien Cassou
>> http://damiencassou.seasidehosting.st
>>
>> "Lambdas are relegated to relative obscurity until Java makes them
>> popular by not having them." James Iry
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> 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: Detecting overriding class extensions

Damien Cassou
In reply to this post by Simon Denier-3
On Tue, Oct 20, 2009 at 2:35 PM, Simon Denier <[hidden email]> wrote:
>> You can have a look at the following script which basically warns you
>> if you load a package that overrides a method IIRC.
>
>
> Sorry but I cant see a difference. Can you detail a use case that I
> can reproduce? (because I know there are still a few overrides in
> Moose but can not reproduce)

You open a Pharo core image.
You load the script.
You load Moose => you will get exceptions if Moose override anything

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry

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