W3C home > Mailing lists > Public > public-qa-dev@w3.org > September 2004

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

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 23 Sep 2004 17:34:36 +0200
To: Martin Duerst <duerst@w3.org>
Cc: public-qa-dev@w3.org
Message-ID: <415ee94b.147308318@smtp.bjoern.hoehrmann.de>

* 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
Received on Thursday, 23 September 2004 15:35:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:54:46 UTC