|
Re: private methods: your opinion wanted: msg#01292lang.smalltalk.squeak.general
On Wed, 28 Aug 2002 09:30:30 -0500 (Central Daylight Time) Aaron <reic0024@xxxxxxxxx> wrote: > On Wed, 28 Aug 2002, Karl Ramberg wrote: > > > I think private methods usually are in the > private category, and not > > necessary > > have a selector name indicating it's private. > [...] > After the original message was posted, I tried > it out, created a > class-side method on a class, #pvtInspectMe, > which simply does a ^ 'hello' > inspect. I then tried calling it in a > workspace with Object pvtInspectMe, > and Squeak told me that it was private, with a > compilation error. That is, > it expanded to something like Object *Private > methods cannot be called > like this.* pvtInspectMe. > > Aaron > > > The compilation error comes from MessageNode >> pvtCheckForPvtSelector: encoder, which checks for the 'pvt' at the beginning of the method. This is what I was asking, that given a clean slate, should code be written to take advantage of having private methods like this. But while I didn't give method categories as an option in the first question, Karl is right that this is the way it is done most of the time. But it is kind of a "soft" private, as opposed to a "hard" private that gives an error. So, if people prefer categories labeled private to actual private methods, you can state that too.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: A new prospect for Squeak + GTK+, yampa |
|---|---|
| Next by Date: | RE: [BUG]Collection>>removeAll:, Valloud Andres |
| Previous by Thread: | Re: private methods: your opinion wanted, David Farber |
| Next by Thread: | Re: private methods: your opinion wanted, Torge Husfeldt |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |