lua-users home
lua-l archive

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


> To put it simply, it lets you use bigints as table keys as if they
> were plain lua ints or floats. E.g.
> 
> local b1 = require("bigint").one
> local i = 1
> local f = 1.0
> local t = {"one"}
> 
> print(t[b1], t[i], t[f]) --> one one one
> print(type(b1), math.type(i), math.type(f)) --> userdata integer float

This should be easy to do using a proxy table with an appropriate __index.