[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [LuaJIT FFI] tonumber() and cdata
- From: Mike Pall <mikelu-1106@...>
- Date: Mon, 6 Jun 2011 20:01:15 +0200
Duncan Cross wrote:
> However, it *does* throw an error if you give it an FFI cdata value
> which is non-numeric:
>
> print(tonumber(ffi.new 'struct { }')) --> (!) cannot convert struct to double
>
> I believe this should be changed, to be consistent with the general case.
I've changed the semantics to return nil on non-numbers.
--Mike