[squeak-dev] Re: miss-used become: ???
Teleplacer
andreas.raab at gmx.de
Sat Jun 9 15:49:07 UTC 2012
Chris Muller-3 wrote
>
> So the whole method would seem to be useless then..
>
To the contrary. First of all, the obvious use here is along the lines of:
foo := Unscripted Player new.
foo assureUniClass.
This makes good sense as it converts foo from an UnscriptedPlayer
into a PlayerXYZ (usually attached to some morph). Returning the
'original' foo is a good idea too if one considers that assureUniclass
is an inplace modification and if the client of that code would need
a reference to the original the *only* way to obtain it is via returning
it from the method. I don't know if the original reference is ever used,
but it makes sense to give the client some way to keep a reference
to the original in case that is needed for some other purpose (undo
perhaps?).
Cheers,
- Andreas
--
View this message in context: http://forum.world.st/miss-used-become-tp4633953p4634072.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.
More information about the Squeak-dev
mailing list
|