[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luaL_register x package.loaded
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Mon, 28 Jun 2010 10:35:28 +0200
2010/6/24 Roberto Ierusalimschy <email@example.com>:
> The function luaL_register (from lauxlib), used to open C libraries,
> registers the new library into the table package.loaded[name]. Most
> libraries, however, also return the new library, so that 'require' will
> assign it to package.loaded[name]. For these libraries, the assignment
> made by luaL_register is mostly useless.
> I would like to know about packages that do depend on that assignment,
> either because they do not return the new library or any other reason.
I tend not to return the module from the luaopen_* function, but only
to mimick the way I write Lua modules. Actually I was calling 'module'
itself from C in early 5.1.x, until it became impossible in 5.1.3 or
5.1.4. I don't think I *need* that behavior though.