lua-users home
lua-l archive

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

I like the idea of having a "table-type" default metatable, like for numbers
and strings.
And to set this metatable to "table" library (like for strings).
then things like t = {"one","two","three"}:insert("four"):sort(...) should
patch is here:

Creating tables with special function that sets the metatable correctly also
fine, but would be nice to have an option to set it once for all the newly
created tables.

function list(t) return setmetatable(t, {__index = table}) end

t = list{"one","two"}:insert(...):

Sent from: