lua-users home
lua-l archive

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

On Thu, Feb 24, 2011 at 12:27 PM, Roberto Ierusalimschy
<> wrote:
> Maybe we should remove/deprecate LUA_PATH/LUA_CPATH? I am not sure how
> useful they are, but all they do can be done easily with LUA_INIT.

>From a user interface point of view, I find LUA_PATH/LUA_CPATH kind-of
cumbersome.  To locate some module in a private directory, both
variables may need to be set, and each may need two paths (e.g.
"/path/to/?.lua" and "/path/to/?/init.lua"), and then you need to
retype the suffix (which could be .dll or .so depending on the system,
possibly either on Cygwin) and append/prepend to the previous path or
default path ";;".  This could be assisted with a helper library

  lua -e "require 'addpath' '../../foo/'" example.lua

and would be even simpler if the LuaJIT style '-j' was supported [1]:

  lua -jaddpath=../../foo/ example.lua