[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Extending assert () functionality
- From: Rebel Neurofog <rebelneurofog@...>
- Date: Sun, 26 Jun 2011 04:21:43 +0400
Guess it isn't clear from the first glance, that assert () has several
ways of usage:
1. local a, b, c,d = assert (open_something ()) -- Here we can have
multiple arguments passed ahead
2. assert (a > b, "Error message") -- Here we don't use multiple
3. local a = assert (open_something_else (), "Error message") -- Here
we discard additional values
returned from 'open_something_else ()'.
If we talk about implementing lazy evaluation of error message there
can be workaround for case 2 and case 3.
But the idea of patching 'assert ()' itself is not to jump from case to case,
but keep using assert () wherever it is reasonable.
BTW the patch only slow downs error case by doesn't affect case of