lua-users home
lua-l archive

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


Er.  "Just very *curious* where a userdata's env member takes effect."  I'm curious.  Gah, I'm also under the weather and can barely type today -.-


On Tue, Dec 3, 2013 at 9:07 PM, Sir Pogsalot <sir.pogsalot@gmail.com> wrote:
I wish I understood more of where the `env' member is used on userdata:

http://www.lua.org/source/5.2/lobject.h.html#env

I was looking into see how easy of a change it would be to allow setting another userdata as the env to a userdata.  I had previously thought it was something pretty low-level, only known to the GC, but now that I look at it I think I will have to concede that my idea is inappropriate. :\  Just very serious where a userdata's env member takes affect.  I like Roberto's idea to associate a table containing all the pair userdatas with the linked userdata as the key and ~weakly-pair~ it.  That's definitely a solution I like, but I'm hoping someone with more core experience can fill me in on what a userdata's env might do apart from be set and accessible with get/setuservalue()

:-)


On Tue, Dec 3, 2013 at 6:31 AM, Sean Conner <sean@conman.org> wrote:
It was thus said that the Great William Ahern once stated:
> Hosting repositories will be dead simple because it simply involves hosting
> a single JSON-formatted manifest file plus the modules, all stored in a
> single static directory.

  Why JSON and not Lua?  Rockspecs are Lua and seeing how this is for Lua
...

  -spc (Just curious ... )