lua-users home
lua-l archive

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


This may be faster:

getmetatable("").__index =
  function (s, n)
    return type (n) == "number"
      and rawget (string, "sub")(s, n, n)
      or rawget (string, n)
  end

--
Shmuel