lua-users home
lua-l archive

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

Luiz Henrique de Figueiredo wrote:
> > The "-i" option loads readline which as a side-effect initializes
> > the NLS locale for the current process from the environment variables.
> If available, readline is compiled into the interpreter. You don't need
> to use -i to activate it.  Do you mean that when you do use interactive
> input then a function from the readline library gets called and only then
> the OS loads the readline library? And so readline is not loaded at all
> when running the interpreter in batch?

I should have been more precise. The shared library is always
loaded (which is a waste without -i). The first time a readline
function is called (only with -i), it's initialized and it sets
the locale.

You can verify that by comparing the output of these two commands:
  strace -e open lua -v
  strace -e open lua -i </dev/null
If you have the environment variables LANG or LC_* set, the output
of the 2nd command shows it opens lots of locale related files.