[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua and env
- From: Terry Moore <tmm@...>
- Date: Wed, 12 Jun 2002 12:54:53 -0400
Indeed, we had to make exactly these kind of changes for using Lua as a general script engine. We stop parsing as soon as we saw a non-flag non-assignment.
We also found it necessary to improve the handling of exit status. If the called script returns a value, it's used as the argument for exit(2). Embedding exit() in a script just to get exit status really reduces re-usability.
I've drafted a long report on our experiences; have thought about posting it but don't know where would be best.
--Terry
At 10:31 PM 6/11/2002 +0200, Edgar Toernig wrote:
>Luiz Henrique de Figueiredo wrote:
> >
> > >It's common to invoke interpreters in this fashion:
> > >
> > > #!/usr/bin/env python
> > >
> > >It doesn't seem that the lua command line interface was designed with
> > >this in mind. Could it be improved to work like other interpreters?
> >
> > How do other interpreters handle this? They don't have command-line options??
>
>They have. But they don't need them to execute a script. They are called
>like this:
>
> interpreter script [arguments]
>
> > What do you suggest?
>
>Remove the -f option and do its action on the first non-option argument.
>
>Ciao, ET.
>
>PS: Maybe you want to have a look at Sol's interpreter. It does it right
>and has (IMHO) some other useful stuff (-r [require], -I [path], atexit,
>env-table, args for -e, ...).