lua-users home
lua-l archive

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


 
> > but that doesn't get around the fact that the luaL_register function
> > doesn't always seem to do what it says on the tin.
> 
> How so? http://www.lua.org/manual/5.1/manual.html#luaL_register says:
> 
>    If there is a table in package.loaded[libname] or in 
> variable libname,
>    reuses this table instead of creating a new one.
> 
> Perhaps the only thing that's is not clear in the docs is that if
> package.loaded[libname] contains a table then the global variable
> libname is not created. Is that what you mean?
> 

Yes that's exactly what I mean :)

My question is though, why is the global not created?  Having it the way
it is, it seems to me that you can never be sure that the global exists
unless you explicitly create it, therefore making the creation in the
first instance redundant.
 








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.