[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Determining if _ENV is the first upvalue of a closure?
- From: Tim Hill <drtimhill@...>
- Date: Thu, 12 Mar 2015 23:37:25 -0700
> On Mar 12, 2015, at 10:22 PM, Daurnimator <quae@daurnimator.com> wrote:
>
> On 13 March 2015 at 00:43, Paul K <paul@zerobrane.com> wrote:
>>
>> You may try to avoid this problem by serializing a special value instead of _ENV. When you serialize the upvalues, you know if the first one points to the _ENV for the given function, so just store a special table value for it, so that when you deserialize it to setup proper value, you know that this function expects _ENV as the first upvalue, so you can do whatever is appropriate in this case.
>
> Do you do this in serpent? ( https://github.com/pkulchenko/serpent )
>
No, we use a custom serializer for performance reasons.
—Tim