[DGD] [Melville] non-static mappings

Erwin Harte harte at xs4all.nl
Wed Feb 6 15:40:30 CET 2002


On Wed, Feb 06, 2002 at 12:15:05PM +0000, Shevek wrote:
> 
> >I do not get your point. In DGD, setting map[key] = nil will remove
> >the key-value pair from the mapping. This is just as safe as map -=
> >({ key }).
> >
> >// Mikael / Elemel
> 
> Are you sure about that?

I am, my code would fall apart if DGD didn't behave like that.

object  ob1, ob2;
mapping map;

  ob1 = ...something non-nil...
  ob2 = ...something non-nil...

  map = ([ ob1: 1,
           2:   ob2 ]);

Now, if either ob1 or ob2 gets destroyed, the relevant index:value
pair in the mapping will disappear.

Regards,

Erwin.
-- 
Erwin Harte <harte at xs4all.nl>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list