[Modules] Upper case message names for accessing modules

ducasse ducasse at iam.unibe.ch
Wed Feb 20 09:02:42 UTC 2002


on 18/02/02 7:42 PM, Hannes Hirzel at hirzel at spw.unizh.ch wrote:
I think that this is the right question?

> 
> My point was just: Is it worth the to have the ambiguity of mixing
> objects and messages which begin all with a capital letter.
> 
> I would prefer the more common
> (A)
> ellipse := (Module path: #(Squeak Morphic Core Basic)
> class: #EllipseMorph) new
> 
> over 
> 
> (B)
> ellipse := Module Squeak Morphic Core Basic EllipseMorph new.
> 
> 
> In the form (A) it is obvious that just a dictionary lookup (more
> or less) is happening. Instead of one large Smalltalk dictionary we now
> have several.
> 

With B How do I distinguish between module and classes.
May be we should not, but in such a case why Module is needed?

Now if I have to explain it to people  I will have to say something like
the class is the latest name with uppercase in the sequence that starts with
Modules. But the class is implicit somehow. First the class is not easily
identifiable, we only see Modules. Then  I could have a module called
Ellipse so there is not distinction obvious distinction between class and
modules. 

Now if I want to create a new module named Ellipse

Should I write 
Modules Squeal Morphic Core Basic MyEllipse new
Is MyEllipse a class or a module?


I think that what is trivial for us can be a pain for newcomers and we
should pay attention. Onece Andrew balck told me that language construct
should reflect the language concepts. This way there are identifiable.


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

Or we can have something new to refer to class in namespace

Stef




                    ) new





More information about the Squeak-dev mailing list