home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!bernina!neptune!santas
- From: santas@inf.ethz.ch (Philip)
- Subject: Re: Object hidden state and side effects
- Message-ID: <1992Dec23.011557.1495@neptune.inf.ethz.ch>
- Sender: news@neptune.inf.ethz.ch (Mr News)
- Nntp-Posting-Host: ru8.inf.ethz.ch
- Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
- References: <knight.724904387@cunews> <knight.724948496@cunews> <1992Dec21.151326.21426@midway.uchicago.edu>
- Date: Wed, 23 Dec 1992 01:15:57 GMT
- Lines: 53
-
-
- In article <1992Dec21.151326.21426@midway.uchicago.edu> dave@alex.uchicago.edu (Dave Griffith) writes:
- >
- >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.)
-
- Example 1:
-
- a := "asd"
- b := "qwe"
-
- We have creation of new objects here. The strings
- "asd" and "qwe" were _not_ preexisting.
-
- Example 2:
-
- c := "asd"
-
- Do you use the same "asd" as before?
- (as far as I remember, you imposed _not_ to)
-
- >Values, as I have been using the term, are immutable, and thus copying may
- >be used as a possible optimization.
-
- Usually _not_-copying is an optimization.
- If something is _definitely _immutable_, why should one need to _copy_ it?
-
- > 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.
-
- This is very confusing.
- In the examples above, which are the objects, which are the values
- and which are the variables?
- (for help, add the operation:
- c.appendToSelf: "f"
- and please, explain what happens during this operation, while
- distinguising between objects/variables/values)
-
- Philip Santas
-
- "In an evolving universe those who stand still are really moving backwards"
- --------------------------------------------------------------------------------
- email: santas@inf.ethz.ch Philip Santas
- Mail: Dept. Informatik Inst. of Scientific Computation
- ETH-Zentrum Swiss Federal Institute of Technology
- CH-8092 Zurich Zurich, Switzerland
- Switzerland
- Phone: +41-1-2547478
-
-
-