[DGD] Re: DGD LPC (?)

Serhat Sakarya serhat at freud.et.tudelft.nl
Mon Aug 3 09:10:51 CEST 1998


On Sat, 1 Aug 1998, Par Winzell wrote:

> > I believe there was a post at some point stating that ({ }) could never
> > equal ({ }) - this is because of references are used rather than the
> > values themselves. Same applies to mappings.
> 
> Yes, a new array is created whenever the interpreter encounters ({ })
> and reference comparison between two separate instances obviously fails. 
> 
> However -- to be quite picky -- since assignment also uses references,
> you -can- have ({ }) equal ({ }), sort of, since
> 
> 	a = b = ({ }), a == b

This is a good point.

> is true... this is a pretty common LPC mistake too, that I see a lot of
> wizards make on Muds, and understandably so, too... since LPC does hide
> most yukky reference stuff well.

Hhm.. I know this from experience... on my mud, we use a 'group daemon'
(for storing members of groups) which uses a mapping for its internal data
structure. I thought it would be nice to give people (and myself) the
the ability to retrieve the entire mapping with one function call... the
implementation was along the lines of 'query_groups_mapping() { return
groups; }' - this was in use for quite a while until someone made it
quite clear to me (by adding himself to the Admin group) that this was
not the smartest idea in the world. OOPS :-)


Regards,

Serhat Sakarya




List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list