[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Needs
- From: Coda Highland <chighland@...>
- Date: Wed, 28 Nov 2018 16:52:38 -0600
On Wed, Nov 28, 2018 at 12:18 PM Sam Pagenkopf <ssaammp@gmail.com> wrote:
>
> Egor Skripturnoff:
>>
>> How to save intermediate value in this code
>> a:b.c()
>> a:b.d()
>> to rewrite it in optimized way
>> local x = a:b
>> x.c()
>> x.d()
>
> Okay, but what would you expect from this?
> a.b = a:b
Using the implementation I was alluding to, that operation would
BASICALLY be a no-op, because the new value of a.b would be a binding
object that exposes the properties of b but gets passed to methods as
if it were a. It would cause issues if you tried to then use a as a
prototype to construct a2, but in and of itself it wouldn't be an
issue.
/s/ Adam