lua-users home
lua-l archive

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


On Thu, Oct 3, 2013 at 7:01 PM, Andrew Starks <andrew.starks@trms.com> wrote:
> On another thread, the "make a library in C" solution was pointed out
> as a way to mitigate a lack of a specific value type in Lua. This was
> what was done for me by LHF when I needed 64 bit ints. (thank you!) It
> has worked well.
>
> While extending Lua functionality by exposing C *functions* is utterly
> painless and transparent, extending lua by exposing *types* is not
> transparent.

Checking type() is wrong, Lua is a duck typing language. With tables
it is quite easy, but with numbers it is harder. Maybe there should be
a numeric() function that can be set via a metatable?

Of course 64 bit ints is the ain use, and will be fixed in 5.3...

Justin