home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!utcsri!newsflash.concordia.ca!grogono
- From: grogono@cs.concordia.ca (Peter Grogono)
- Subject: Re: Object hidden state and side effects
- Message-ID: <BzMpwB.7y3@newsflash.concordia.ca>
- Sender: usenet@newsflash.concordia.ca (USENET News System)
- Nntp-Posting-Host: concour.cs.concordia.ca
- Organization: Computer Science, Concordia University, Montreal, Quebec
- References: <BzF7tn.22C@inews.Intel.COM> <knight.724800099@cunews> <BzMnKp.B4J@inews.Intel.COM>
- Date: Mon, 21 Dec 1992 21:48:11 GMT
- Lines: 22
-
- In article <BzMnKp.B4J@inews.Intel.COM> bongalon@tcad05.intel.com (Ben Bongalon) writes:
- >
- >my question is:
- >
- >why would you want to consider "i" and "(i^5)" as equal but not
- >identical values? Do you consider "1" and "(3-2)" equal but not
- >identical also? From a pragmatic point of view, the distinction
- >between the simplified and unsimplified forms of the expressions
- >seem questionable.
-
- It depends what you mean by "pragmatic". It is true that, when we are
- thinking informally, there is not much difference between "1" and
- "3-2". But there is a vast difference computationally. Many
- languages, including Prolog, are formally defined as term languages.
- In a term language, "1" and "3-2" are different terms and are thererfore
- unequal. A Prolog interpreter needs a simplifier, which would not be
- part of a "formal" implementation, to turn one into the other.
- The consequence is that arithmetic predicates behave differently
- from other predicates, although implementations try to hide this as
- much as they can.
-
- Peter
-