lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


All very true.  I knew there would be a good reason why it is the way it
is, I just couldn't work it out myself :) 

> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br 
> [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of 
> alex.mania@iinet.net.au
> Sent: 28 January 2008 13:48
> To: Lua list
> Subject: Re: Hashing userdata
> 
> Not to mention it would be annoying beyond belief to lose 
> userdata already stored inside tables whenever you change the 
> data inside of it.
> 
> On Mon Jan 28 20:27 , Javier Guerra Giraldez 
> <javier@guerrag.com> sent:
> 
> >as most inmutable-strings languages, Lua makes all identical 
> strings be 
> >the same.  that is, at creation time, if a string matches 
> another one, 
> >the new one is discarded and the old one is used instead.
> >
> >you wouldn't want this to be done automatically to your 
> userdata, since 
> >Lua can't know what you'll do with the contents.  IOW, 
> userdata isn't 
> >inmutable; therefore can't share the same space for several 
> instances.
> >
> >so, for userdata, the hash source is the pointer, not the content.
> >
> >--
> >Javier
> 
> 


 
---------------------------------------------------------------------------- 
         DISCLAIMER 
This email is sent by The Creative Assembly Limited company No. 03425917, registered in England &Wales registered office 27 Great West Road, Middlesex, TW8 9BW, England. The contents of this e-mail and any attachments are confidential to the intended recipient and may also be legally privileged. Unless you are the named addressee (or authorised to receive for the addressee) of this email you may not copy, disclose or distribute it to anyone else. If you have received this email in error, please notify us immediately by e-mail on postmaster@creative-assembly.co.uk and then delete the email and any copies. The Creative Assembly Limited have made all reasonable efforts to ensure that this e-mail and any attached documents or software are free from software viruses, but it is the recipient's responsibility to confirm this.