[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What is the equivalent of die() command of perl
- From: Miles Bader <miles@...>
- Date: Fri, 11 Sep 2009 12:11:08 +0900
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.