|| at Sep 5, 2010 at 12:30 pm
On Sep 05 14:19:16, Kalle Sommer Nielsen wrote:
Is there any reason for we don't support expressions like:
test() or throw new Exception('test() failed');
If no, is there any argument against supporting such a syntax in trunk?
Technically, it should be quite easy to have that available, but it
might become tricky to handle cases like: foo(throw exception()); or
even "throw throw throw new Foo;" ? :)
Also, I consider "or die" patterns to be a bad idea, extending it for
exceptions might make it a tad bit better, but I still find that bad
because of i.e. non trivial precedence rules:
include("foo") or throw new Exception("ads");
it will neither include "foo" nor throw any exception.