# # -----Original Message-----
# #  From: Tony Olekshy [mailto:[EMAIL PROTECTED]]
# #  Sent: Tuesday, August 22, 2000 4:01 PM
# #  To: [EMAIL PROTECTED]
# #  Subject: Re: Exception stack: let's use the @@ list.


# # Peter Scott wrote:
# # >
# # > Brust, Corwin wrote:
# # > >
# # > > I've come to like @_ as our input list and think that
# #   > > exception handling blocks would naturaly use this.
# #   > >
# #   > > Also it seems convienent, which seems perlish.
# #   >
# #   > I find myself indifferent on the subject of where the exception
# #   > stack is stored (well, at least indifferent to the choices of @_
# #                  > and @@), even given the ramifications of each.  I
would like to
# #   > see each mentioned as alternatives; I don't mind which one is
# # > preferred.

# # Consider this case:

# #     catch $@->{severity} eq "Fatal" => { ... }

# # Are you proposing to make @_ the exception stack in the catch
# # expressions too, as is:

nope, just B<within> C<catch>.

catch 
        map $@->isa($_), qw( list_o_classes )   # works, for me
        {  
                warn; throw ;                     # but I like this better
then

                warn "$@"; throw $@;              # this
        }

Doesn't it seems logical that the argument list would contain the exception
stack for block defined to handle exceptions?


# # Remember, these are expressions and blocks, *not* subs.  In such
# # cases I excpect @_ to reflect the surrounding context, not magically
# # start to appear to be something different.  I expect the following
# # to print B:

# #     @_ = qw(A B C); try { ... } finally { print $_[1] }

which is right and good.

# # Remember RFC 88 + MOTIVATION + Rule 1:

# #      1. The ability to distinguish the normal control flow from
# #         the exception handling flow to make the structure of the
# #         program clear.

I guess I might prefer:

        The ability to write exception handling code in (much) the same
manner as code which handles normal program behavior.

# # For many decades the telephone industry has *not* used normal phone
# # lines to send failure messages, because if the failure message is
# # that the line is down, well, you get the picture.  Instead, they
# # have long relied on a seperate signalling channel.  That's $@.

I that it's actually $! B<and> $@. but we are introducing something new to
per here.  A code block specifically for the purpose of handling the
(previously?) global variable formerly known as $@.  IMHO it is reasonable
to consider C<catch> a subroutine for that purpose.

The disadvantage of localizing @_ for the C<catch> block seems, to me,
outweighed by the consistency offer in keeping block input (clearly the
exception stack, for C<catch>) in @_.

# # -----Original Message-----
# # From: Peter Scott [mailto:[EMAIL PROTECTED]]
# # Sent: Tuesday, August 22, 2000 3:33 PM
# # To: Brust, Corwin; 'Tony Olekshy'; [EMAIL PROTECTED]
# # Subject: RE: Exception stack: let's use the @@ list.
[...]
# # the ramifications of each.  I would like to see each mentioned as 
# # alternatives; I don't mind which one is preferred.

That seems fine.

***

Much sorry if I seem to be getting snarky here, but I'm not much good at
arguing with people clearly more knowledgeable them myself.

-Corwin

Reply via email to