[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Registry and references
- From: Romulo Bahiense <romulo@...>
- Date: Mon, 25 Jun 2007 14:32:56 -0300
I wonder and ask myself whether the address of a C object isn't, in the
end, exactly that: an integer key?!
Yes, a pointer is a integer value, in C. In Lua, numbers and
lightuserdata are different things. A number is (usually) a double
floating point value, while a lightuserdata is an opaque pointer. The
struct describing both have different tags (LUA_TNUMBER /
In the same sense, an string containing four bytes could be an (32bit)
integer as well.
In other words: there will be no collision between a numeric key and a