^((super new) initialize)

Andrew C. Greenberg werdna at mucow.com
Sat Aug 18 11:41:19 UTC 2001


On Friday, August 17, 2001, at 09:31 PM, Gary McGovern wrote:

> Hello,
> I've seem to have messed up an image and am interested to know how.
>  
> I overrode the class method new with ^((super new) initialize)

First, the parentheses are unnecessary, for Squeak parses left to right, 
thus, the idiom is usually:

	^super new initialize

Second, this is a very common idiom that routinely works.  Perhaps you 
might provide us with some details to help you to work this through.  
For example, in what class did you do the override?

> and thereafter the super new methods wouldn't work.

I'm not sure what you mean by that.  Are you saying that after modifying 
a superclass' class method, you were unable to create instances of the 
subclass?  This suggests that you might have accidentally overwritten an 
instantiation method in the wrong class.

> Also, in a class I couldn't declare the instance variable 'name'. I had 
> to use personName instead.

I'll wager that the superclass has a subclass with such an instance 
variable.  Yes?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1522 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010818/f8ba7ba7/attachment.bin


More information about the Squeak-dev mailing list