<div dir="auto">One thing to remember: I see too many reasoning about methods, some methods can have meta information in pragmas or classification (category). But in Smalltalk we must not be reasoning about method. We must think in term of messages. Smalltalk is messaging all the way down. So if the message does not carry privacy information, how is it going to work? One implementor could be private, the other not, we cannot tell at compile time if not expressed in the message. With methods, we can only instrument at execution time. We can even check the sender... But at compile time, every bit of information must be in the message.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 11 juin 2019 à 22:00, Gerald Klix via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why can't we just add some pragma, let's name it "scope" or <br>
"protection"? We can add those without renaming methods,<br>
we could easily add other protection levels<br>
and they won't clutter otherwise nice methods-names with<br>
'irrelevant' prefixes. With some additional effort,<br>
we can hide or mark those methods in the browsers, too.<br>
<br>
Again just my 0.01€.<br>
<br>
<br>
Best Regards,<br>
<br>
Gerald<br>
<br>
<br>
<br>
On 11.06.2019 20:27, Phil B via Cuis-dev wrote:<br>
> (sorry for all the posts on this subject)<br>
> <br>
> Just to clarify, I'm in favor of using pvt*/private* where it makes sense.<br>
> I'm not in favor of extending pvt* visibility class-side as it would create<br>
> a new inconsistency between variables and methods similar to the one that<br>
> this whole thread started to try to resolve. (i.e. we'd be solving one<br>
> problem and creating another)<br>
> <br>
> This kind of brings it back to the method comment that Juan wants to get<br>
> rid of: while I think that a more explicit method name for those setters<br>
> would be a good thing rather than relying on the comment alone, I also<br>
> think that keeping a method comment explaining *why* we made those methods<br>
> in particular private (i.e. we really don't want the methods to even exist<br>
> as we want immutable instances) is a good thing.  Just look at how we're<br>
> trying to reverse-engineer why pvt* works the way it does... some better<br>
> documentation left behind by someone 20 years ago would have avoided this.<br>
> <br>
> <br>
> On Tue, Jun 11, 2019 at 1:56 PM Phil B <<a href="mailto:pbpublist@gmail.com" target="_blank" rel="noreferrer">pbpublist@gmail.com</a>> wrote:<br>
> <br>
>> Juan/Hernan,<br>
>><br>
>> On Tue, Jun 11, 2019 at 1:37 PM Juan Vuletich <<a href="mailto:juan@jvuletich.org" target="_blank" rel="noreferrer">juan@jvuletich.org</a>> wrote:<br>
>><br>
>>> On 6/11/2019 8:56 AM, Hernan Wilkinson wrote:<br>
>>><br>
>>> A few comments:<br>
>>> 1) super pvt* it is not allowed because "private" parts of a class are<br>
>>> only visible to its instances, at least that it is how c++/java and the<br>
>>> like treat private stuff (methods, vars, etc). So in Java you can not do<br>
>>> super.prvt*().<br>
>>> The behavior you are proposing Phil would be like "protected" in those<br>
>>> languages. In fact, we could say that inst. vars. in Smalltalk are<br>
>>> protected in the c++/java parlance.<br>
>>> So, my guess is that the current restriction on super pvt* came from that<br>
>>> understanding "private".<br>
>>> Having said that, I see no problem to change that restriction and treat<br>
>>> pvt* messages as they were protected although it will be confusing to<br>
>>> explain when compared to other languages. I think it would be better in<br>
>>> that case to have prt* (protected) instead of pvt* but that would generate<br>
>>> a migration problem...<br>
>>><br>
>>><br>
>>> Mhh. Difficult decision. We could keep the 'pvt' prefix, but in methods<br>
>>> that handle them, we could add comments stating that it is like what<br>
>>> c++/java calls "protected". The error could be "Protected messages may only<br>
>>> be sent to self" (protected instead of private).<br>
>>><br>
>><br>
>> I've done both Java and C++ development and it never even occurred to me<br>
>> that they might have been the inspiration for pvt*.   That makes a lot of<br>
>> sense though as I think this convention was added late-90's.<br>
>><br>
>> The reason it probably never occurred to me at least is because I've<br>
>> always been bothered by the definition of 'private' as it applies to<br>
>> ivars/cvars vs pvt* for methods.  So I guess the question is, which is more<br>
>> confusing to users: that pvt* wouldn't work the way they're used to in<br>
>> other languages or that pvt* is internally inconsistent with the ivar/cvar<br>
>> concept of privacy.<br>
>><br>
> <br>
> <br>
> <br>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>