Re: [WMVS] Some initial thoughts on code M12N...

* Martin Duerst wrote:
>Also, exceptions can catch one error, but they are not very
>good at reporting various errors in sequence out of the
>same code. (unless perl exceptions are so much better
>than anything else I know).

They probably are in a sense, you can throw all sorts of data structures
as exceptions, array references, hash references, objects, strings, etc.
you could do e.g. something like

  sub Errors::new { bless [ qw(a b c) ], shift }
  eval { die Errors->new };
  print "$_\n" foreach @{$@}

so there is little difference between using exceptions to report errors
or other means. This would be more difficult to achieve with Java as the
exceptions are not expected to be multiple ones, while you could have an
exception class that implements a list as above it would disable the
ability to catch the exceptions by type, you would have to catch the
list exception and then post-process it which would probably look odd in
Java.

Received on Thursday, 23 September 2004 15:35:23 UTC