lua-users home
lua-l archive

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


Hi

> Luiz Henrique de Figueiredo wrote:
> 
> > >Is there some limit that we aren't aware of?  Stacks,
> > >global namespaces, etc.?
> >
> > There are no limits on the number of times dofile may
> > be executed.
> 
> As a side note to the above, although it looks like you can call 
dofile()
> as many times as you want sequentially, I think there is a potential 
limit
> on the number of *nested* dofile() calls.
Yes, it's right. And Lua can also go out of C stack space (see "char 
source[MAXFILENAME];"
 in lua_dofile()).

> During the time that do_main() is executed, the file handle f is 
open.  If
> there are nested do_file() calls, then the user will be limited by 
number
> of open files the operating system provides.  This doesn't seem to be 
the
> case for the problem described above, but is a limit you may want to 
either
> document as system dependent or remove by reading the whole file in 
as a
> string and closing the file prior to do_main().
I prefer closing the file prior to do_main(): when I'm editing a Lua 
program, I can't save it if it is also running in Lua.

Bye
Mauro