home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!uchinews!alex!dave
- From: dave@alex.uchicago.edu (Dave Griffith)
- Subject: Re: Object hidden state and side effects
- Message-ID: <1992Dec21.151326.21426@midway.uchicago.edu>
- Sender: news@uchinews.uchicago.edu (News System)
- Organization: University of Chicago
- References: <1992Dec20.162050.14652@midway.uchicago.edu> <knight.724904387@cunews> <knight.724948496@cunews>
- Date: Mon, 21 Dec 1992 15:13:26 GMT
- Lines: 36
-
- In article <knight.724948496@cunews> knight@mrco.carleton.ca (Alan Knight) writes:
- >In <knight.724904387@cunews> knight@mrco.carleton.ca (Alan Knight) writes:
- >
- >>In <1992Dec20.162050.14652@midway.uchicago.edu> dave@alex.uchicago.edu (Dave Griffith) writes:
- >
- >>>>Normal storage (or mutable values): State can be modified, but there
- >>>>is no identity operation. e.g. storage allocated on the stack in
- >>>>traditional languages.
- >
- >>>'Splain me, boss. I'm feeling dumber than usual.
- >
- >Let me try that again more concisely, having rested my brain cells.
- >
- >Consider objects which are mutable but for which assignment is really
- >copying. An identity operation for such objects is meaningless because
- >no two can ever be identical. However, any individual object can be
- >modified.
- >This is the normal case for data not represented by pointers in
- >traditional languages.
- >
-
- You're using assignment a lot differently then I have been. When I think
- of assignment, I just mean binding values/objects to names. There is no
- creation of new objects involved. (Call this reference assignment.)
- Values, as I have been using the term, are immutable, and thus copying may
- be used as a possible optimization. The actual semantics of assignment is
- still just binding values to names. Variables aren't modified. Objects are
- modified, variables just get rebound, which results in the object containing
- them (if any) being modified.
-
-
-
- --
- Dave Griffith, Information Resources, University of Chicago,
- Department of Surgery dave@alex.bsd.uchicago.edu
- A man's best friend is his dogma.
-