[squeak-dev] Why is #String->String an Alias?

Bert Freudenberg bert at freudenbergs.de
Thu Dec 19 22:03:55 UTC 2013


On 19.12.2013, at 22:53, Chris Muller <asqueaker at gmail.com> wrote:

> On Tue, Dec 17, 2013 at 7:35 PM, Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com> wrote:
>> Bingo, by instrumenting basicNew with self name == #Alias ifTrue: [self
>> haltOnce], I got my first Alias during update 228, with previous version of
> 
> Where did you put that in relation to the primitive call?

I don't think you can do it without adding a new method:

Behavior>>basicNew
	self name == #Alias ifTrue: [self haltOnce].
	^ self actualBasicNew

But what I'd actually do is this:

Alias class>>basicNew
	self haltOnce.
	^ super basicNew

Then you would only have to check for "self name == #Alias" if Alias had subclasses.

- Bert -




More information about the Squeak-dev mailing list