On Sat, Feb 12, 2005 at 02:20:45PM -0600, Patrick R. Michaud wrote:
: > And I've yet to receive a good answer for what C<3/any(0,1)> does to $!.
:
: I'm sure that 3/any(0,1) throws some sort of divide by zero exception;
: same as 3/0 would, and places the exception into $!. I don't know
: that $! must necessarily then be a junction of exceptions, or that the
: exceptions would have to be processed in parallel (i.e., as with many
: things, processing of the value/list/object/junction stops at the
: first exception encountered). But someone more expert than I would
: need to provide an answer to that one. :-)
I think this is a really good argument for unthrown exceptions,
AKA "interesting values of undef". In Perl 6 you don't really
get in trouble for producing undefined values--you're not really
in bad trouble till you start trying to *use* an undefined value
to do something defined. Being undefined is just a funny kind of
tainting, as it were. As long as the undef remembers that it was
undefined because you tried to divide by 0 back at line 42, that's
probably good enough for the user to trace back and find the error.
Or think of each individual undef as containing a little cockpit
recorder telling how it got there.
But if you say
3 / any(@foo) == 1
it shouldn't really care if any of the values are undefined, I think.
(All subject to pragmatic control, I suspect.)
Larry