lua-users home
lua-l archive

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


Здравствуйте, Roberto.

Вы писали 11 января 2017 г., 15:19:05:

>> Section 6.3 of the manual states that package.path and package.cpath
>> are initialized by Lua using environment variables LUA_PATH or
>> LUA_CPATH &c. as appropriate.
>>
>> That seems not to be the case for Lua 5.3.4: the code in question
>> has been moved from loadlib.c in 5.3.3 to lua.c in 5.3.4. Thus, the
>> environment variables may only be processed for the stand-alone lua
>> executable.

>   | At start-up, Lua initializes this variable with
>   | the value of the environment variable [...]

> It does not specify whether "Lua" is the library or the program.  So,
> the manual is imprecise, but not incorrect :-) But yes, that changed
> in 5.3.4 and the manual can be clearer about this matter.


>> What, by the by, was the reason for moving the code out of loadlib.c?

> Full programs using Lua probably want its own control over the paths
> used by the Lua code inside it.  Moreover, it seems cleaner to put
> all dependencies on environment variables outside the libraries. (For
> instance, before we had to use a trick to pass the '-E' option into the
> library.)

> -- Roberto


There also usecase when standalone Lua app creates new Lua state (e.g.
for  use  it  in separate OS thread). So with this changes its require
also  updates  all  such modules. In other case it will breaks current
code. So I do not think it is small changes to minor update.

--
С уважением,
 Alexey                          mailto:alexeymelnichuck@gmail.com


---
Это сообщение проверено на вирусы антивирусом Avast.
https://www.avast.com/antivirus