home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!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.005532.1237@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: <BzIFGp.K7@cs.uiuc.edu> <1992Dec20.155809.14236@midway.uchicago.edu> <BzKv4J.3Lt@cs.uiuc.edu>
- Date: Wed, 23 Dec 1992 00:55:32 GMT
- Lines: 42
-
- In article <BzKv4J.3Lt@cs.uiuc.edu> johnson@cs.uiuc.edu (Ralph Johnson) writes:
- >
- > Probably you can enforce
- >reflexivity by stating that an object is equal with itself whenever you
- >create a new object.
-
- I'm not sure you can do this if you use pointers:
- If you define equality as equality of the adresses of _objects_,
- then
-
- x == (x.increment)
-
- might give you True :-(
-
- >I don't have any idea about transitivity, nor about
- >substitutability of equals for equals.
-
- You cannot do this safely in an environment with side effects,
- since we have the same case as above.
-
- >If it turns out that there is a way to express that in Eiffel, how about
- >my example of requiring that a function used by a sorter provide
- >a total ordering on the collection to be sorted. I guess you could
- >do this for any particular finite collection by checking all triples.
-
- But you cannot always provide a total ordering. You cannot even provide
- a partial ordering: you can write the identity function in infinity
- number of ways; can you provide an algorithm that orders a collection
- of functions?
-
- 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
-
-
-