I'm still not convinced that this is NECESSARY, but if it were to be
implemented, I think this would be best.
A special parser hook is probably possible; provided that we're just talking about replacing instances of the invalid syntax
"x=y:z" with
"function x(...) return y:z(...) end"
I don't think it's a good idea though. The current syntax has the advantage of clarity. If you need terser code, probably better to write a helper function. For example:
function metafunctions_to_closures(object)
local new_object=shallow_copy(object)
for k,v in pairs(getmetatable(object)) do
if type(v)=='function' then
new_object[k] = function(...) return v(new_object,...) end
end
end
return new_object
end