Public/Private is not just a category, it is also a declaration of
what is the interface of the object.
As I said, it's not critical, but I've been working with and without a
"native" private method, and I prefer working with them.

Namespacing is a different animal, and not as simple to implement as
private methods.

Best regards,

Esteban A. Maringolo

On Thu, Aug 19, 2021 at 9:59 AM Jesus Mari Aguirre
<jmariagui...@gmail.com> wrote:
>
> Please keep Pharo simple, why do you need private methods...you can include 
> then in a protocol named private...other language have it...yes...next 
> addition will be namespaces...other...I don't know...at last we have Java
>
> El jue., 19 ago. 2021 9:00, Richard O'Keefe <rao...@gmail.com> escribió:
>>
>> Many years ago there was a proposal in the Squeak mailing list about 
>> enforcing
>> a naming convention, "pvt",  I implemented that in my Smalltalk system.  The
>> compiler enforces the rule that pvt.[A-Z].* message can only be sent to
>> (self|super) (basicNew|basicNew: n|new|new: n|pvtNew: n)?
>> in a class method or
>> (self|super) ((class (new|new: n)|pvtSpeciesNew: n|pvtClone)?
>> in an instance method.
>> There are currently
>> 9412 public selectors
>>  793 pvt* selectors and
>>    23 private* selectors,
>> where the last group is methods that I *want* to be private in some sense but
>> cannot do with this machinery.  (For example, calling a "private" method on
>> another object known to be of the same class.)
>>
>> I think the evidence shows that this works well enough to be useful, even if 
>> it
>> isn't quite as expressive as I'd like.  And what *that* means is that
>> this can be
>> done with a style check, using the machinery Pharo already has for style 
>> checks.
>>
>>
>>
>> On Wed, 18 Aug 2021 at 08:14, Craig Johnson <cr...@hivemind.net> wrote:
>> >
>> > Hi All,
>> >
>> >
>> > Just a newb off-the-wall question.
>> >
>> > Is there any good reason why we can't create a true private method in a
>> > Pharo class by putting that method inside an instance or class variable
>> > as a lambda (block).
>> >
>> >
>> > This would reduce one of my biggest bugbears with Pharo, namely the
>> > pollution of the global namespace with every single message name in the
>> > entire system.
>> >
>> >
>> >
>> > Craig

Reply via email to