home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!inews.Intel.COM!tcad05!bongalon
- From: bongalon@tcad05.intel.com (Ben Bongalon)
- Newsgroups: comp.object
- Subject: Re: Object hidden state and side effects
- Message-ID: <BzBC1L.3GJ@inews.Intel.COM>
- Date: 15 Dec 92 18:15:20 GMT
- References: <1992Dec11.163449.18439@crd.ge.com> <1992Dec13.152136.16852@hasler.ascom.ch> <1992Dec14.112222.13987@kei.is.s.u-tokyo.ac.jp> <1992Dec15.014420.6604@midway.uchicago.edu>
- Sender: news@inews.Intel.COM (USENET News System)
- Reply-To: bongalon@tcad05.intel.com (Ben Bongalon)
- Organization: Intel Corporation, Santa Clara, CA USA
- Lines: 40
- Nntp-Posting-Host: tcad05
-
-
- In article <1992Dec15.014420.6604@midway.uchicago.edu>,
- dave@alex.uchicago.edu (Dave Griffith) writes:
-
- |> Actually, immutability is only a small part of being a value. The important
- |> part is lack of identity. All '3's are the same, regardless of their
- history.
- |> On the other hand, standard objects are only equal if they are identical.
- |> Immutability is necessary for values, but not sufficient.
-
- Actually, it depends on how you look at it. Are "all" 3's referring
- to several identical copies of that value or to one universally
- accessable value? Not only is he latter a plausible answer but
- I believe it is a better model.
-
- Frankly I don't understand all the confusion about the distinction
- between objects and values. As i see it, an object may have internal states;
- more specifically, an object may contain other objects, which
- may in turn be composite (ie, contain other objects) or simple
- (ie, just contains values). But note that simple and composite
- objects are merely concepts in our minds. In order to apply them
- to computer programming, we map these objects into variables.
-
- The primitive objects are the
- variables in a program that are defined with primitive data types
- (ie, int i, float x, char c <--- i,x & c are primitive objects).
- Composite objects are the variables in a program that are outside
- the set of primitive objects.
-
- An object can be ultimately decomposed into its primitive object
- constituents, and these primitive objects get _values_ assigned to them.
- Thus, the disctinction between objects (variables) and values
- (literals) is clear. Objects get values assigned to their data
- members. Object X = Object Y actually means that the values of
- the data members of Y get assigned to the corresponding data members
- of X.
-
-
- Ben Bongalon
- Intel Corporation
-