On 19/10/2010 13:13, spir wrote:
<snip>
The example uses an Excpetion type, but the somewhat comment
contradicts it. Can one really use any kind of object as exception?
Yes.
How does D then handle it?
The mechanism is class-agnostic. The only thing it relies on is that
it's an object of some class type.
I was expecting (from exp with other
language) there to be a root Error or Exception type implementating
base exception mechanics and/or an imposed interface to comply with
Imposed interface to do what with the exception?
OK, so I can think of one example it would be nice to have: stack
traces. This could be implemented in Exception, I suppose. But still,
restricting throw to this class would be a puristic rather than
practical step forward.
(esp a kind of string method returning what text to write out when
the exception is not caught).
<snip>
Object.toString()
Stewart.