[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: A common base exception object for Perl - RFC
Pete Jordan <pjordan1@email.mot.com> writes:
>Stephen Zander wrote:
>
>> As someone who bitched loud & long about this at the last conference I
>> have one question: do you plan to fix all the croak calls in the
>> current source code and/or supply some mechanism for XS programmers to
>> Do The Right Thing as well? The whole point of having *any* exception
>> class is wasted if it only applies to custome code
>
>This will involve more digging into perlguts than I've yet done, but
>yes, if this mechanism is to exist, it should work everywhere. AFAICS,
>hacking C<Perl_vcroak()> and C<Perl_vdie()> should provide for C and
>Perl compatibility respectively. Adding some sort of pseudo-object croak
>interface for XS programmers is another kettle of dioxin-contaminated
>lobsters altogether.
If C code just does what it does now all the way down to the
hunk(s) that do(es) the longjmp() to actually "thow" the exception
then we can just convert the string at that point into an object.
Sounds very do-able
>
>Well, the method has got to be there so stringification can happen
Given that it is 'C level magic' that triggers the overload call
in the first place, we could add alternate 'C level magic' that did that.
Indeed $@ is _already_ magical ...
>(and
>so exception subclasses can, errm, subclass it).
That though is a valid point.
>There's no compulsion
>for anyone to actually /use/ it explicitly...
>
>Pete
--
Nick Ing-Simmons
- Follow-Ups from:
-
Pete Jordan <pjordan1@email.mot.com>
- References to:
-
"Redford, John" <John.Redford@fmr.com>
Pete Jordan <pjordan1@email.mot.com>
Stephen Zander <gibreel@pobox.com>
Pete Jordan <pjordan1@email.mot.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]