conversion instantiation (was "Integrating the RegisteringFileList")

Craig Latta Craig.Latta at NetJam.ORG
Tue Jan 22 20:47:05 UTC 2002


Hi--

	I think >>asFoo messages are generally defensible as long as they're
implemented such that they make sense for all possible receivers (that
disqualifies most of the ones in Object :). The >>as: idiom always
seemed a little odd to me, since, if you know the name of the class to
which you're converting, you probably know the instantation protocol as
well. It seems the convenience sought here is not having to remember so
many class names.

	In my experience, the number of conversions for which the
"as<classname>" form is really most descriptive are few, and certainly
not worth inventing tricky infrastructure. I'm willing to tolerate
things like String>>asFilename (especially since they enable more
compact chained-send expressions). But such stuff in Object which isn't
meaningful for all objects just makes the system less readable. Anyway,
much more common are cases where I want to convert something into
another form which has a meaningful name within the terminology of the
problem domain. For example, converting an Eye into a description of its
geometry in a facial animation editor.

	Bijan writes:

> Evidence suggests that a ban isn't going to cut it. So what's the solution?

	I think it's just good case-by-case judgement, and not a simple
generalization (because the problem isn't big enough to justify one).


-C

--
Craig Latta
composer and computer scientist
craig.latta at netjam.org
www.netjam.org
crl at watson.ibm.com
Smalltalkers do: [:it | All with: Class, (And love: it)]



More information about the Squeak-dev mailing list