[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Suggestion] Passing upvalues to load()
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 6 Oct 2015 10:44:40 +0200
2015-10-06 0:55 GMT+02:00 Soni L. <email@example.com>:
> I think load() should, in addition to _ENV, also take a list of upvalues,
> which are only used when loading bytecode.
> When loading bytecode _ENV is assumed to be the first upvalue, upvalue 0, so
> we just need to make it varargs for the other upvalues.
> This reduces the need for debug.upvaluejoin() (or w/e, setupvalue?) when
> loading bytecode.
This is obviously a good suggestion. How easy would it be
to make a wrapper that would achieve it in presently-available
Lua? I have no time now, but if when I look at this list at 18:00
UTC, nobody has contributed it yet, I'm willing to have a go.