Squeak already has private method support (was Re: FW:
Pressures for
Substantially New Squeaks)
Mark A. Schwenk
mas at wellthot.com
Thu Feb 18 16:28:11 UTC 1999
"Mark A. Schwenk" wrote:
> It appears that Squeak already has private method support.
> Just begin your private method names with 'pvt'.
> You can only send pvt* messages to self (note that this also means an instance
> creation class method cannot directly send a pvt* message).
>
> I'm not sure who implemented this. Perhaps Andreas Raab? Maybe the proud papa
> of this code can step forward and add any more insights here.
>
> Execute the following expression to see some of the relevant implementation:
>
> Smalltalk browseMethodsWhoseNamesContain: 'pvt'.
>
> -Mark Schwenk
Note that the current checking for private messages is done at compile time, not
run time.
If another object such as an object's class wants to send a private message to
an object,
it can still still use an expression of the form "object perform: pvtMessage" to
circumvent
the compile-time privacy protection.
More information about the Squeak-dev
mailing list
|