Without metatables? No. Metamethods are the only way to invoke a function to evaluate tbl.foo
. You could make MyObject
a userdata, but again you need a metatable to provide the __index
metamethod.
Learn to love metatables. They are the backbone of C/Lua integration.