request

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

request

Steve Dekorte-6
It would be really usefull to me to have a hook for when a function was declared in Lua.
Something like:

function declarefunction(source)
   ...
end

setfunctionmethod(declarefunction)

Steve

Reply | Threaded
Open this post in threaded view
|

Re: request

John Belmonte-2
Steve Dekorte wrote:
>
> It would be really usefull to me to have a hook for when a function was
declared in Lua.
> Something like:
>
> function declarefunction(source)
>    ...
> end
>
> setfunctionmethod(declarefunction)

Can't you use the setglobal tag method on nil?  In the tag method just check
for the new value being a function.  I'm doing this in my old overloaded
function example (http://www.egroups.com/files/lua-l/overloaded.lua).

Unfortunately with Lua as it stands now you'll have to extend assignment to
global and assignment to table separately...

-John