lua-users home
lua-l archive

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

To force reconstruction of cached methods, the thing to do would be to add a
version stamp to the class and to the method caches. Before using a value
from the method cache, check to see whether the cache is up to date. If it
isn't toss the contents of the cache. You could maintain the method cache
stamp in the class via a __newindex metamethod.

Note that this will not handle the reload case because that makes a new
class. To handle that, one could probably pass the old class into the
constructor as an optional parameter or just write the creation code as:

    MyClass = MyClass or class()