lua-users home
lua-l archive

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

On Mon, Sep 22, 2008 at 11:10 PM, Wesley Smith <> wrote:
> This is certainly a stupid thing to do, but nonetheless I don't think
> it should hang a process.  Try the following:
> Lua 5.1.4  Copyright (C) 1994-2008, PUC-Rio
>> dofile(nil)
> This was on OSX (10.5.x).  IMHO it should check for a nil arg and
> simply return with an error like dofile('') does:
> Lua 5.1.4  Copyright (C) 1994-2008, PUC-Rio
>> dofile('')
> cannot open : No such file or directory
> stack traceback:
>        [C]: in function 'dofile'
>        stdin:1: in main chunk
>        [C]: ?
> please consider fixing this for a future version.

This is intended according to the manual:

loadfile ([filename])

Similar to load, but gets the chunk from file filename or from the
standard input, if no file name is given.


-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant