lua-users home
lua-l archive

Re: experience implementing a module system

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


Edgar Toernig wrote:
> I made a patch for lua 4.0a that allows upvalues to access locals in outer
> scopes. Semantically it does just what you did by hand, that is inserting
> a "local foo=%foo" (but without actually creating the intermediate local).
> Everything else stays the same. You can find the patch at
> http://user.exit.de/froese/lua/upvalue-4a-patch
>
> I ask the designers to look at the patch and include it into the final 4.0
> version. It's fully backwards compatible, makes the upvalue handling more
> orthogonal, fits pretty well into the parser, and removes this annoying
> restriction.
Speaking of orthogonal handling and upvalues, I would like to use the
upvalue syntax in the global scope. Combined with your patch I could just
write %var everywhere without having to think about what scope I'm in.
-John

AltStyle によって変換されたページ (->オリジナル) /