[Modules] Upper case message names for accessing modules
Norton, Chris
chrisn at Kronos.com
Fri Feb 22 01:35:45 UTC 2002
[ I hope I'm not showing too much ignorance here; I admit that I haven't
really been following the modules discussion very carefully... I've been
awfully busy with work ]
It seems to me that:
ellipse := Squeak Morphic Core Basic EllipseMorph new.
Or the other variants of that statement are unduly clunky. There is a rule
of thumb that I recall, the "Law of Demeter" that basically suggests: if you
want to change the channel on your TV, use the knobs, don't open it up and
mess around with the wiring.
I interpret this to mean that we should avoid multiple message sends in a
single statement (of course cascading is a useful exception). I truly think
that Smalltalk's power is in its simplicity
aReceiver aMessage
To make a longwinded story short, might I suggest that we strive to keep
Squeak's syntax as simple as possible. Perhaps something like this would
work:
SqueakMCB := ModuleReference new: #(Squeak Morphic Core Basic).
ellipse := SqueakMCB.EllipseMorph new.
Heck, I'm shootin' from the hip here, but to continue this idea, perhaps we
could have a (gasp) global pool dictionary that associates module shortcuts
(keys) with explicit module references (values). Then any old chunk of code
could look like this:
ellipse1 := MorphicCore.EllipseMorph new.
ellipse2 := MyMorphicModule.EllipseMorph new.
ellipse1 = ellipse2 ---===> false
Then later, if/when a file-out is desired, module references get their own
section in the file-out that describes them completely for that file-out.
Cheers,
---==> Chris
More information about the Squeak-dev
mailing list
|