At 10:16 AM 8/16/00 -0400, Chaim Frenkel wrote:
>One issue that haven't seen addressed, is how to _not_ have exceptions.
>
>I want to use a core module (non-core can do anything they want) but
>I'd like to write it in procedural mode.
>
> try {
> $obj->method...
> }
> catch { }
> finally {}
>
>or
>
> $status = $obj->method...
>
>And have both work properly.
Yes, I want this too. The method could certainly look to see whether it's
in void context and throw an exception if so; in fact Jarkko suggested this
just now on p5p:
>Mental note: in Perl 6 system calls by default should die if their
>return value isn't checked.
Short of setting some global switch, I don't see how else to do
it. However, this doesn't address the issue of functions which return
values anyway and signal errors through $!. If we get open() modified as I
and others would like:
my $fh = open $filename;
how should we distinguish the one that throw()s from the one that doesn't?
--
Peter Scott
Pacific Systems Design Technologies