lua-users home
lua-l archive

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


> 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