[Modules] Upper case message names for accessing modules

Bijan Parsia bparsia at email.unc.edu
Wed Feb 20 15:22:37 UTC 2002


On Wed, 20 Feb 2002, ducasse wrote:

[snip]
> For ellipse := (Module path: #(Squeak Morphic Core Basic)
>                      class: #EllipseMorph) new
> 
> this could be better
> as 
>     ellipse := (Module class: #EllipseMorph inPath: #(Squeak Morphic Core
> Basic) new
>     because we are interested in the class

Except, the class isn't in the Path is it? so

	ellipse := ((Module at: #(Squeak Morphic Core
Basic)) class: #EllipseMorph) new.

Yuck. Bit better if you have teh at:class: method, but still.

Hmm. Thinking Pythonically, it might be nice to be about to use import
statements at the class or module level. I'm not clear on where the above
expressions are to occur. If I have to write such things in my methods,
then it's a yucky and I hope rare case that needs quick refactoring and I
really don't *care* if the syntax blows (though this is an argument for
the verbose and against the convenient)>

I would hope that having to get at a class in a module explicitly would be
as rare as having to do Smalltalk at: #EllipseMorph.

(But I don't yet understand modules or their use :))

Cheers,
Bijan Parsia.




More information about the Squeak-dev mailing list