lua-users home
lua-l archive

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

 Whoa, a plethora, a torrent, of solutions :-)
Actually, I patched the lua+ distro that sits in the base of my projects.
I'm just wondering how will deal with it when I upgrade to 5.1

O = {}
setmetatable(O, {__index = function (t, k)
  k = string.match(k, "^x(.*)")
  local v = tonumber(k, 16)
  t[k] = v
  return v

I like that code. I will definitelly use the idea to
make some of my code more easy to use. Thanks.