lua-users home
lua-l archive

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


> >> - weak tables
> >
> >What is it?
>
> Key and/or values in weak tables are subject to GC, ie, they may
> be collected.
> The reference mechanisms will be implemented using a weak table
> in 4.1, but
> there are others uses: see LTN 6.
>
> This is another example of metamechanisms: instead of implementing weak
> references, we implemented something more general... But it's left to you
> Lua programmers around the world to find ways of exploiting it.

Thank you.

> >I can't figure out what (print or write)(9) will do...
>
> That was just an example. But it calls print or write, if print
> is not defined.

OK, since I though that print will always be defined (which isn't true since
it resides in a library), I missed the point...

> >I would like to see binary operations: and or xor, perhaps shifts. This
> >would help to parse binary headers of files, among other things,
> and doesn't
> >cost much.
>
> There are libraries for this, aren't there?

Yes, but what I would like is to put these functions in the standard math
library, ie. in the official release. Ie. in the official lua.exe. So if I
use such a function in a (standalone) script, users won't have to fetch the
special lua.exe able to process it. These are quite standard functions, hard
to emulate in Lua only.

Unless the "require" mechanism makes my request pointless...

Regards.

--._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`--