[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: state of the Lua nation on resource cleanup
- From: Mark Hamburg <mark@...>
- Date: Tue, 17 Feb 2009 09:59:53 -0800
On Feb 16, 2009, at 5:16 AM, Roberto Ierusalimschy wrote:
1. There needs to be a way to replace the environment on a function
get a new function. ..
2. It would be nice to have a way to call a function with a
environment even if that function has a protected environment.
call_with_environment( environment, nesting, fn, ... )
If you have (1) than you get (2), no? (Create the clone and call it.)
Yes, (1) gets you (2) though it comes at a price in memory allocation.
But (1) seems dangerous in some scenarios.
I don't see that it's any more dangerous than setfenv. It just avoids
stomping other uses of the function.