3 ms·
I'm surprised to hear that, given how closely Wren's semantics resemble that of Lua's. Lua uses the left metatable's metamethod for two tables or userdata, or
by samatman 4y ago
I'm surprised to hear that, given how closely Wren's semantics resemble that of Lua's.
Lua uses the left metatable's metamethod for two tables or userdata, or the metamethod if the binary operator has a primitive on one side of the argument.
This gives elegant results at the expense of some implementation complexity: there's no mechanism to figure out what's happening inside the metamethod, all you know is that if both sides are metatable-able, you're in the left side's method.