Modules and class... [ a off-topic question ?]
Hannes Hirzel
hirzel at spw.unizh.ch
Wed Feb 27 07:27:33 UTC 2002
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.
Isn't this basically what Lex gives?
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?
Cheers
Hannes Hirzel
More information about the Squeak-dev
mailing list
|