lua-users home
lua-l archive

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


steve donovan <steve.j.donovan@gmail.com> writes:
> f = assert(io.open(file))
> ...
> This actually gives a sensible error trace, because if io.open fails
> it returns two values, nil and an error message. The second parameter
> of assert() is the message string, so it works as expected.

Gee, never noticed that before... and lots of lua functions have exactly
the right return profile to do this!

-Miles

-- 
Genealogy, n. An account of one's descent from an ancestor who did not
particularly care to trace his own.