lua-users home
lua-l archive

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


On Tue, Oct 23, 2012 at 2:00 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Tue, Oct 23, 2012 at 7:35 AM, Rena <hyperhacker@gmail.com> wrote:
>> be interesting if we could access local variables by table indexing
>> syntax".
>
> It can be done with the debug library, but it _is_ going to be slow,
> especially for witing to upvalues (read-only can be cached)
>
> A variant of this "wouldn't it be cool" we've discussed is accessing
> upvalues when compiling strings.
>
> steve d.
>

It can be done now, but only as a hack. The main thing I had in mind
(and the reason I mentioned print in the first place) was functions
designed around this capability, so e.g. print would have a local
variable for you to change if you want to send its output somewhere
else.

-- 
Sent from my Game Boy.