"TSa (Thomas Sandlaß)" schreef:
> Larry Wall:

>> Another potential issue is that CATCH doesn't distinguish exceptions
>> coming from the current block from those coming from the subcall to
>> a(). So it could end up returning Failure from the current block when
>> you intended to force return of Failure from a().  Not sure what
>> to do about that...
> I don't understand this issue. I think we have the fact that
> *every* operator is at least conceptually dispatched and as
> such everything in a block is at least one level down in the
> call chain just as a() as a sub call is. This is why a CATCH
> block inside the block is so natural to me.
> If I understand your intention correctly you want to be able
> to force a thrown exception from a() into a returned value
> and proceed where this return value is supposed to show up
> in the current block, right? The simplest solution that comes
> to my mind is some form of goto to that position. Or is that
> too inelegant? The point is how the CATCH block knows from
> which subordinate scope the exception originates.
>    a() proceed: orelse b();
>    CATCH
>    {
>       ... # make $! into return value
>       goto proceed;
>    }
> This kind of needs to know the variable the return value of a()
> is stored into. This is easy if orelse is checking $! anyway.
> But does it? And is it possible to have labels in the middle
> of a line as above?

Maybe the "=" should deliver the normal (=value) part of the
return-stash, and a different deliverer should be used to get other
information out of it.

Affijn, Ruud

"Gewoon is een tijger."

Reply via email to