digitalmars.D.bugs - In/Out can't throw.
- AJG (8/8) Aug 20 2005 Hi,
- Derek Parnell (9/18) Aug 20 2005 At first, I thought this might be because contract failures are not mean...
- AJG (3/14) Aug 20 2005 I haven't seen it anywhere.
- =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= (33/49) Aug 27 2005 -----BEGIN PGP SIGNED MESSAGE-----
Hi, For some reason, one can't throw exceptions within In/Out blocks. This seems rather arbitrary; moreover, it's pointless because you can get around it with a dummy function. So, is this "by-design," or just an oversight? Either way, it would be nice to eliminate this inconvenient restriction. Thanks, --AJG.
Aug 20 2005
On Sun, 21 Aug 2005 04:59:25 +0000 (UTC), AJG wrote:Hi, For some reason, one can't throw exceptions within In/Out blocks. This seems rather arbitrary; moreover, it's pointless because you can get around it with a dummy function. So, is this "by-design," or just an oversight? Either way, it would be nice to eliminate this inconvenient restriction.At first, I thought this might be because contract failures are not meant to be recoverable, but from testing it seems you can catch an assert error coming from an out{} block. So I don't understand this restriction either. Is it documented? -- Derek Parnell Melbourne, Australia 21/08/2005 3:42:02 PM
Aug 20 2005
I haven't seen it anywhere. I say leave the docs alone, and just get rid of it ;). --AJG.For some reason, one can't throw exceptions within In/Out blocks. This seems rather arbitrary; moreover, it's pointless because you can get around it with a dummy function. So, is this "by-design," or just an oversight? Either way, it would be nice to eliminate this inconvenient restriction.At first, I thought this might be because contract failures are not meant to be recoverable, but from testing it seems you can catch an assert error coming from an out{} block. So I don't understand this restriction either. Is it documented?
Aug 20 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 AJG schrieb:There are two interesting question tough. http://www.digitalmars.com/d/dbc.html 1) Has "throw" side effects? 2) If "throw" has now side effects, what is the exception tree of the following code? a) Exception -> SomeException b) Exception -> {auto insert: InException} -> Exception **** class SomeException : Exception{ } void sample() in{ throw new SomeException; }body{ } Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDEJ/N3w+/yD4P9tIRAjR8AKDEfuTPxfByAlIl68DoDFDeK0438gCgg/lk Yp1VwuXPsArleHokvBsNRkI= =b97T -----END PGP SIGNATURE-----I haven't seen it anywhere. I say leave the docs alone, and just get rid of it ;).For some reason, one can't throw exceptions within In/Out blocks. This seems rather arbitrary; moreover, it's pointless because you can get around it with a dummy function. So, is this "by-design," or just an oversight? Either way, it would be nice to eliminate this inconvenient restriction.At first, I thought this might be because contract failures are not meant to be recoverable, but from testing it seems you can catch an assert error coming from an out{} block. So I don't understand this restriction either. Is it documented?
Aug 27 2005