lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>In Lua, if you want to send a message to an object, but only if that 
>method exists you can do:
>if object.message then
>  object:message()

You could add an "index" tag method for this.  Something like this:

 local NOP=function () end
 settagmethod(tag(object),"index", function () return %NOP end)