lua-users home
lua-l archive

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


It was thus said that the Great Dirk Laurie once stated:
> 2015-03-28 6:05 GMT+02:00 Sean Conner <sean@conman.org>:
> 
> > Then perhaps I have the wrong mental image of how upvalues work in Lua,
> > because it's doing things I don't expect.
> >
> >   Okay, explain to me like I'm five how this works.
> 
> I'll start on it right now, but while I do that, you can
> in the meantime check whether the answer is maybe
> already in here:
> 
> https://github.com/dlaurie/lua-notes/blob/master/upvalues.html

  Not quite.  You come close in the "Modifying upvalues from the calling
program" section, but I wasn't expecting the _ENV upvalue to be shared quite
so promiscously.

  -spc