lua-users home
lua-l archive

Re: request

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


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

AltStyle によって変換されたページ (->オリジナル) /