internal static LuaObject tostring_event(LuaObject op) { var handler = getMetamethod(op, "__tostring"); if (!handler.IsNil) { return(handler.Call(op)[0]); } else { return(op.ToString()); } }
internal static LuaObject concat_event(LuaObject op1, LuaObject op2) { if ((op1.IsString || op1.IsNumber) && (op2.IsString || op2.IsNumber)) { return(op1.ToString() + op2.ToString()); } else { var handler = getBinhandler(op1, op2, "__concat"); if (!handler.IsNil) { return(handler.Call(op1, op2)[0]); } else { throw new LuaException("Invalid op"); } } }