Re: Clean Object Class Design -- Circle/Ellipse

From: Richard MacDonald <macdonaldrj_at_att.net>
Date: Sun, 07 Oct 2001 03:37:03 GMT
Message-ID: <z5Qv7.33509$WW.2163789_at_bgtnsc05-news.ops.worldnet.att.net>


"Bob Badour" <bbadour_at_golden.net> wrote in message news:cd3b3cf.0110061710.60f86f60_at_posting.google.com...
> brangdon_at_cix.co.uk (Dave Harris) wrote in message
news:<memo.20011001000009.35593A_at_brangdon.madasafish.com>...
> > bbadour_at_golden.net (Bob Badour) wrote (abridged):
> > > Ask him to point to any Smalltalk language definition that defines
> > > "instance" as anything other than a variable which one can reference.
> >
> > The 1997 draft of the ANSI Smalltalk standard (which is the version of
the
> > standard I have to hand), says:
> >
> > A /variable/ is a computational entity that stores a single
> > reference (the /value/ of the variable) to an object.
> >
> > [...] An /object/ is a computational entity which is capable of
> > responding to a well defined set of messages. An object may
> > also encapsulate some (possibly mutable) state.
> >
> > This is *not* saying an object is a variable.
>
> "reference to an object" implies that "object" is variable.

Nope. It implies that the reference is the variable. It says nothing about the object itself.

> Values are
> self-identifying and one cannot reference a value. One can reference
> storage or memory that contains some representation of a value, but
> storage and memory are variable. That a variable is constrained to a
> single value for some period of time does not change its nature.

Even when that particular variable *cannot* change, i.e., is indistinguishable from a value. Well, you're consistent at least. Incomplete theory though.

> That's not to say that no such thing as an object value exists. Object
> value is an important concept just as object variable is an important
> concept.

Oh please, tell us more.

> If you had included a little more from the standard where it defines
> /message send/ and explains that "Each argument is a reference to an
> object", you would see that Smalltalk requires a variable in order to
> send a message. In other words, Smalltalk only pretends to have values
> and requires one to store a representation of a value in a variable
> prior to doing anything.

No again. Same point as above. The reference (attribute) is the variable. This says nothing about the object being referenced.

5 squared.

I just don't see the variable there. Unless, like you, I make one up and wrap it around the value 5 to make my theory consistent. But I question who is doing the pretending: you or Smalltalk.

>

> > (The ANSI standard does not define "instance". It uses "object" instead.
> > Later it says that when an object does have state, it represents it with
> > special kind of variables called "instance variables". In other words,
an
> > object is not a variable but an object can contain variables.)
>
> How does one change part of something that cannot change?

One doesn't. One cannot change the SmallInteger 5.

>

> > > An instance or variable can have the value 5. The value, however, is
> > > not an instance.
> >
> > So sorry, but in Smalltalk the value 5 is an instance of the class
> > SmallInteger.
>

> Untrue. An instance of the class SmallInteger can contain a
> representation of the value 5, but the value 5 is not an instance of
> anything. I realize that Smalltalk confuses things by requiring
> variables for messaging and then pretending that variables are values.

I see your philosophy now. Values are only within God's domain. Everyone else must deal with representations.

> > > One cannot reference a value. Values are self-identifying.
> >
> > Indeed 5 is self-identifying. We can send a message to the value 5
whether
> > or not we have a variable referring to it.

>

> Yes, I agree that one can have operations on values. These are, of
> course, different from update operations on variables. Have you not
> seen me state that previously?

No we haven't. We've been showing you examples of operations on values and you've been telling us we're fooling ourselves.

> Of course, the Smalltalk standard
> requires all implementations to operate only on variables.

Of course :-)
Luckily it allows me, the programmer, to pretend I'm actually working with values.

> > > According to the definition of the Smalltalk language an instance is a
> > > variable that one can reference.
> >
> > Again, so sorry, but my reading of the ANSI definition of Smalltalk says
> > that an instance (or object) is something which responds to messages.

>

> My reading of the same says that one can reference an instance (or
> object), which means it must have some physical existence. Variables
> have physical existence where each stores some representation of a
> value; values have no physical existence. Values exist regardless of
> physical representation.

God's domain again. Thanks, I've got it now.

>
> > Perhaps you are talking about some other language, also called
Smalltalk?

>

> No. I just read with a little extra care and a little better
> understanding of the concepts involved.

And a religion. Received on Sun Oct 07 2001 - 05:37:03 CEST

Original text of this message