[Cuis-dev] Why can't you send to super on private (pvt*) methods?

Juan Vuletich juan at jvuletich.org
Mon Jun 10 15:24:44 PDT 2019


On 6/10/2019 5:09 PM, Phil B via Cuis-dev wrote:
> Something I've never understood is why you can't send super on pvt* 
> methods?  The sends are still contained to the class hierarchy and 
> it's legal for a superclass to send to a pvt* that is only defined on 
> a subclass... so why isn't going in the other direction allowed?

Good question! I see no reason. Given that a class can assign values to 
inherited variables, there's already no protection. So I think that 
calling super pvt* method should be allowed. Anybody can see a reason?

BTW, we'd really make methods such as #setCollection:, 
#setNumerator:denominator:, actually all methods set*, all methods 
private* and all methods in a 'private*' category actually private... 
For example the comment at #privateSetX:setY: looks so silly.

Opinions?

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



More information about the Cuis-dev mailing list