[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: The "make the special type in C" journey and type
- From: Justin Cormack <justin@...>
- Date: Thu, 3 Oct 2013 20:04:23 +0100
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