[Modules] Upper case message names for accessing modules
Hannes Hirzel
hirzel at spw.unizh.ch
Wed Feb 13 17:55:59 UTC 2002
Hi
On the swiki page
http://minnow.cc.gatech.edu/squeak/2252
Creating and accessing modules in code
where it is explained how to access modules:
Module @ path
Module fromPath: path
Module @ #(Squeak VMConstruction)
a new way of accessing submodules was added
<citation>
You can also send uppercase messages to a module to access its
submodules. So if moduleA has a submodule named ModuleB:
moduleA ModuleB
This will return the submodule. Ie. the message is the exact name of the
submodule.
</citation>
I don't like this idea. It sacrifies regularity of the syntax for a tiny
benefit.
(moduleA subModule: #ModuleB)
is a construct on can understand with ease and is no big additional effort
for to write down.
Perhaps the reason for a short form of notation is that accessing
submodules will be something performed very often. But even then
I would prefer the standard Smalltalk message send solution.
Cheers
Hannes Hirzel
More information about the Squeak-dev
mailing list
|