lua-users home
lua-l archive

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


A way to tear off new copies of a function would definitely be useful. For
example, I've got a class system that allows for arbitrary sequences of
mixin classes. It would be great if when constructing a class out of mixins,
I could tear off fresh copies of the functions and give them environments
that would represent information such as their position in the mixin
sequence.

Without support for creating multiple versions of the same function with
different environments, one could almost replace setfenv with an extra
parameter to load to set the environment on the newly loaded function.

Mark