Re: [OpenWrt-Devel] Support for callable metatable for ubus-lua

2016-06-29 Thread Jo-Philipp Wich
Hi Anton, personally I do not like peeking into foreign objects meta tables just to find out whether they're callable. Maybe we should simply stop checking the type entirely and instead rely on lua_pcall() to deal with non-callables and other runtime errors. What do you think? ~ Jo _

Re: [OpenWrt-Devel] Support for callable metatable for ubus-lua

2016-06-29 Thread Anton D . Kachalov
Hi. Who is the right person to address such question? Felix, Luka? 17.06.2016, 18:10, "Anton D. Kachalov" : > Hello. > > I'm newbie in Lua and tries to expose several objects' methods to ubus. In > current implementation only function is allowed as methods, but I need to > pass objects to such

[OpenWrt-Devel] Support for callable metatable for ubus-lua

2016-06-17 Thread Anton D . Kachalov
Hello. I'm newbie in Lua and tries to expose several objects' methods to ubus. In current implementation only function is allowed as methods, but I need to pass objects to such functions. Here is the snippet: local uci = require "uci" local ubus = require "ubus" local uloop = requi