[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: :? syntactical sugar request
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 9 Apr 2001 15:19:13 -0300 (EST)
>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()
>end
You could add an "index" tag method for this. Something like this:
local NOP=function () end
settagmethod(tag(object),"index", function () return %NOP end)
--lhf