Lua - how to use the anything function?
Hi - like for js, there seems to be an 'anything' function in lua.
I need a function in lua that will basically take any key-value pair I send (e.g. "xm 21").
Since i have a dynamic list of key names, I want something like an 'anything' function, rather than naming each function specifically.
I can use it with the js object, but for whatever reason, in Lua (jit.gl.lua) i can get int, float and list functions to work, but not "anything".
I'm just trying like so (and sending in random messages like "xm" and "xm 21")
function anything(...)
print("anything")
end
.. with variations "anything()", "anything(v)", but no luck.
Does anyone know how to make this work?
Thanks, /Gert
.. I can also set up a listener, however it doesn't seem to contain useful information for dealing with inbound messages.
This listener is invoked for any message i send to the lua object:
function listenfct(event)
print("evt.subject: ", event.subjectname)
print(table.concat(event.args, ", "))
end
listener = jit.listener(this.name, listenfct)
But the only info I get is something like:
evt.subject: u669004146
last_inlet