[E-Lang] '==' (was: Immutable map operations)

Karp, Alan alan_karp@hp.com
Mon, 26 Mar 2001 10:29:00 -0800


> -----Original Message-----
> From: Mark S. Miller [mailto:markm@caplet.com]
> Sent: Friday, March 23, 2001 10:44 PM
> To: Karp, Alan
> Cc: Dean Tribble; Tyler Close; e-lang@eros-os.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
behavior.

> 
> 
> >Then there's always the destruction of one of them.
> 
> All selfless objects must be PassByCopy or 
> PassByConstruction, referred to 
> generically as pbc.
  			(snip)

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?

> 
>         Cheers,
>         --MarkM
> 
> _______________________________________________
> e-lang mailing list
> e-lang@mail.eros-os.org
> http://www.eros-os.org/mailman/listinfo/e-lang
> 

_________________________
Alan Karp
Principal Scientist
Decision Technology Department
Hewlett-Packard Laboratories MS 1U-2
1501 Page Mill Road
Palo Alto, CA 94304
(650) 857-3967, fax (650) 857-6278
https://ecardfile.com/id/Alan_Karp
http://www.hpl.hp.com/personal/Alan_Karp/