Modules and class... [ a off-topic question ?]

David Simmons David.Simmons at smallscript.com
Wed Feb 27 20:26:54 UTC 2002


> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org [mailto:squeak-dev-
> admin at lists.squeakfoundation.org] On Behalf Of Hannes Hirzel
> Sent: Tuesday, February 26, 2002 11:28 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: RE: Modules and class... [ a off-topic question ?]
> 
> 
> Hi David,
> 
> On Tue, 26 Feb 2002, David Simmons wrote:
> 
> > Lex Spoon wrote:
> [snip]
> 
> > > I think my intuitive decomposition of classes and modules may be
> > similar
> > > to others', so let me toss it out.
> > >
> > > A class primarily declares a number of instance variables, and
holds a
> > > number of methods, and can be instantiated.  It can also define
> > > variables in a local scope, but that's secondary and not even
> > necessary
> > > if we have modules.
> >
> > You've described a constructor, not a class.
> >
> 
> 
> Are you sure?
> 
> The classical definition:
> 
> Goldberg / Robson - Smalltalk-80, 1989 ("Purple book") p.8
> 
> "A class _describes_ the implementation of a set of objects that all
> represent the same kind of system component. The individual objects
> described by a class are called its instances. A class describes the
form
> of its instances' private memories [i.e. instance variables, HH] and
it
> describes how they carry out their operations.
> 

Ok. That's a definition. 

Do you believe that to be a complete and accurate description of what
Smalltalk-80 classes were at that time?

Do you believe that to be a complete and accurate description of what
Smalltalk-98 classes were at the time of the ANSI standard?

If the answer to either of these questions is yes, then you should
re-examine the implementations of classes within a Squeak image.

The description you provided is the description of a constructor. It is
not an adequate description of what a Smalltalk class is, as it has been
manifested in Smalltalk-80 and later implementations.

> 
> Isn't this basically what Lex gives?

Yes, it is basically the definition Lex gives. It is just that both are
incomplete/abridged. They both describe a constructor, and are an
insufficient description for a Smalltalk class definition.

If you think I am wrong, just take a look at all the arguments to a
class definition method in your Squeak image. Tell me how each one
relates to the definition provided. What does a Smalltalk class
declaration define and describe exactly? I am asking you to think
outside the stiflingly old/early and narrow box described in your quoted
definition and Lex's definition. 

To look at meta-object protocol (MOP-services) OO software design, OO
languages and concepts, and how they have diversified and evolved to
their rich forms today, including in various Smalltalks. To look at the
union of those ideas in understanding what such a "class specification"
is.

Note, in QKS Smalltalk and in SmallScript the behavior hierarchy is:

    Object
        Behavior
            Constructor
                Class
                Metaclass    

> How does this definition relate to the definition of "constructor" you
are
> using? I think the discussion "modules and classes" will benefit from
a
> common understanding of this basic term. Would it be possible that you
> elaborate a bit on this please?

Lex described, in his most recent post, that:

"A namespace is one of the most important parts of a module.  Another
important part is dependency information, which normally wouldn't be
included in an individual class (you could, but it would seem like quite
a burden!).  What aspect of modules have I left out, that you consider
important?"

Like the constructor, vs class definition, Lex's definition of a module
is, at best, incomplete/abridged.

Take a look at the classic definitions and implementations of a module
from languages like C/C++/Pascal and other Algol derived languages.
I.e., Look inside a shared-library file on Linux, or a DLL on Windows,
or a CodeFragment on the MacOS.

-- Dave S. [www.smallscript.org]

> 
> 
> Cheers
> Hannes Hirzel
> 




More information about the Squeak-dev mailing list