[self-interest] Is there something in SELF like "become" in smalltalk?
randy.smith at gmail.com
Thu Jan 9 06:49:10 UTC 2014
By the way Michael, of course in addition to method parameters, there are the "temporaries" or "local" slots in a method activation (stack frame). But I can understand your confusion over the handbook statement, as there is normally no difference between "x" and "self x," so who cares. It's just unnecessarily verbose.
Interestingly, saying "self x" is kind of like using Java or Smalltalk's super, but one level down in the inheritance chain (which goes activation -> receiver -> recevier parent -> ...)
The only problem I can see is if you built your objects with x slots in both the method body and the receiver and had to use "self x" and "x" to denote which you meant, you're likely doing something more befuddling than beneficial, and you yourself might end up the victim of your own seeds of confusion. I suspect this is kind of what Dave meant by referring to puns being misleading.
On Jan 8, 2014, at 9:05 PM, David Ungar wrote:
> 1. Yes, Self has a one-way become: it redirects all references to one object to a clone of the other.
> 2. It's bad style because punning locals and slots in the receiver can easily mislead the reader.
> On Jan 8, 2014, at 12:38 PM, mpaap <michael at mpaap.de> wrote:
>> Hello SELF-group,
>> I am writing a term paper about SELF and would like to ask some questions in
>> the next days.
>> I have got some years of experience in Java and some basic knowledge about
>> Mir first questions:
>> 1. Is there something like Smalltalk's "become:" in SELF? A message, which
>> causes replacing all references to the receiver with references to the
>> 2. In chapter 2.3.4 of the SELF handbook explicit messages to self are
>> described as "bad style" because of the facht, that this would prevent
>> searching in local slots (of the activation object) before searching in the
>> receiver. Ok. But the only case I can see, where this would do any harm, is,
>> if a parameter slot of the message has the same name as a slot of the
>> receiver. Can you give me another example?
>> Thanks in advance,
>> View this message in context: http://forum.selflanguage.org/Is-there-something-in-SELF-like-become-in-smalltalk-tp7572538.html
>> Sent from the Self mailing list archive at Nabble.com.
More information about the Self-interest