Adding and removing methods

Lex Spoon lex at cc.gatech.edu
Tue Mar 16 19:16:05 UTC 2004


Jules Dubois <de6l5rp02 at sneakemail.com> wrote:
> Lex Spoon wrote:
> > If you aren't sure, keep in mind that you can always so no and then make
> > a snapshot before trying again.  That way, if anything goes wrong, you
> > can resume from the latest snapshot.
> 
> Is a snapshot what I get if I select "save as new version" from the World
> menu?  That would beat copying the "three files" back and forth between
> temporary directories like I did when I was experimenting with installing
> browsers (in this case, Refactory and Whisker),

Yes, that and "save as".  Much more convenient.


> >>    For example, I tried to create a 'new' method in one of my classes
> >>    and received a message, "Warning: new is used in the existing class
> >>    system ...".  Is this just a problem with new?
> > 
> > You get this warning whenever you define a class method for something
> > that is already being used in the system.  This is often a mistake, but
> > #new is an exception to this exception.  [...]
> 
> I don't quite understand this statement.  It's a mistake for me to use an
> existing selector for a new purpose or it's a mistake for me to use
> (override) #new?

It's just a warning.  In the case of #new, the warning is going
overboard.




> My new theory is, stated in terms of '==',
> 
>     Squeak can't determine that the receivers of '==' would never be
>     instances of my class, so it warned me of the existence of these 
>     other receivers when I tried to remove it from my class.
> 
> Is this closer to reality as defined by Squeak?

Yes, that's pretty good.  In general, the warnings really are just
warnings, i.e. information that something looks funny.

Honestly, even in a statically typed language, the "errors" are often
just warnings that the compiler is treating severely enough to reject
the program.


-Lex



More information about the Squeak-dev mailing list