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

Juan Vuletich juan at jvuletich.org
Tue Jun 11 10:29:34 PDT 2019


On 6/11/2019 2:18 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> On Mon, Jun 10, 2019 at 10:24 PM Juan Vuletich via Cuis-dev 
> <cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>> wrote:
>
>     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?
>
>
> How would you do that? Changing isPvtSelector to see if the methods 
> implementing it are only present in 'private' categories? Extending it 
> to include 'private' prefix sounds reasonable, but I'm not sure about 
> 'set' prefix, because some objects are not intended to be immutable 
> and it might make sense to have public selectors like #setName: for 
> example (although I would probably call it #name: instead).
>
> I know some of my code would break, for example sometimes I allow 
> objects that play a "factory" role to call setters of other objects 
> (this might be a bad thing, still not decided). It would be 
> interesting to see how many methods in the current image would stop 
> compiling if we do this, tho... even if we don't make this change, 
> finding out where this (arguably black) pattern is used might be 
> interesting...

No, I just suggest we start adding the pvt prefix to methods we want to 
be private. Just that.

-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190611/b62916d2/attachment.htm>


More information about the Cuis-dev mailing list