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.004259.1076@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: <1992Dec17.221333.3023@midway.uchicago.edu> <knight.724800436@cunews> <1992Dec20.162050.14652@midway.uchicago.edu>
- Date: Wed, 23 Dec 1992 00:42:59 GMT
- Lines: 29
-
-
- In article <1992Dec20.162050.14652@midway.uchicago.edu> dave@alex.uchicago.edu (Dave Griffith) writes:
- >knight@mrco.carleton.ca (Alan Knight) writes:
- >>
- >>Immutable objects: Have no operations which modify state, but have an
- >>identity operation. e.g. non-mutable strings
- >
- >Might be useful, although the need for an identity operation for non-mutable
- >strings escapes me.
-
- Usually you want this in order to minimize the storage requirements
- of your system. If two equal strings as stored in the same address,
- then you spend the half memory for storing them; as bonus, the equality
- operation for strings becomes _fast_, and an interpreter which
- uses a plethora of symbols, becomes faster. Some widely used systems
- exploit this technique since the last decade...
-
- 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
-
-
-