[E-Lang] '==' (was: Immutable map operations)
Mon, 26 Mar 2001 10:29:00 -0800
> -----Original Message-----
> From: Mark S. Miller [mailto:email@example.com]
> Sent: Friday, March 23, 2001 10:44 PM
> To: Karp, Alan
> Cc: Dean Tribble; Tyler Close; firstname.lastname@example.org
> Subject: RE: [E-Lang] '==' (was: Immutable map operations)
> At 04:43 PM Friday 3/23/01, Karp, Alan wrote:
> >Mark Miller wrote:
> >> All selfless objects are immutable. Selfish object may be
> >> mutable or not.
> >> Two selfless objects are == when they are indistinguishable.
> >> Two selfish
> >> objects are == when they are in the same object -- the result
> >> of the same
> >> act of object creation.
> >So I asked myself, are there any times it would matter that
> two selfless
> >objects are not in the same object? Yes, I said to myself,
> when there are
> >externialities. Hmmm, I said. What kind of externialities?
> How about side
> >effects, such as access counters? Yeah, that's one.
> Selfless objects are necessarily immutable.
But can't access to immutable objects cause changes in other objects? For
example, pay per use on an object may cause an increment in an external
billing object. That's one reason why I use getters even for Java static
variables while I'm prototyping; I never know when I want to add some such
> >Then there's always the destruction of one of them.
> All selfless objects must be PassByCopy or
> PassByConstruction, referred to
> generically as pbc.
Yep. That does it.
> >We ran into this same issue with e-speak vocabularies (which
> are immutable).
> >We decided the only meaningful definition of == was
> identical objects even
> >for immutables.
> Destruction is mutation. Given your issues, I claim that
> your vocabularies
> weren't immutables.
Still, they're different from objects with internal state that can change.
What should we call them?
> e-lang mailing list
Decision Technology Department
Hewlett-Packard Laboratories MS 1U-2
1501 Page Mill Road
Palo Alto, CA 94304
(650) 857-3967, fax (650) 857-6278