[Pharo-dev] Rules

Max Leske maxleske at gmail.com
Sun Nov 22 10:31:05 EST 2015

> On 22 Nov 2015, at 16:20, stepharo <stepharo at free.fr> wrote:
> With the following (broken) definition
> printOn: aStream
>    super printOn: aStream
>    aStream nextPutAll: '(', faces printString , ‘)'

So, it’s broken because of the missing ‘.’. That means the message sent is #printOn:nextPutAll:.

> I got this strange rule:
>    Rewrite super messages to self messages when both refer to same method

Perfectly reasonable. The rule says that in this context it doesn’t effectively make a difference wether you send #printOn:nextPutAll: to super *or* to self. *But* from an aesthetic point of view (at least) self is better than super.

> I do not get it and it looks really suspicious to me.
> Any suggestions?

I guess you were expecting “Sends different super” (at least I would). I think those two rules are complementary. But “Sends different super” would probably be enough to cover both cases. Not 100% sure though.


> Stef

More information about the Pharo-dev mailing list