develooper Front page | perl.perl5.porters | Postings from October 2011

Re: Are exceptions "still broken" in core Perl?

Thread Previous | Thread Next
From:
Chas. Owens
Date:
October 26, 2011 02:35
Subject:
Re: Are exceptions "still broken" in core Perl?
Message ID:
CAH2YjjFoWMGok-bYyAy2UJjVDg+_t64Hao_pV7XrnHSBsEurBA@mail.gmail.com
On Oct 25, 2011 11:21 PM, "Joshua ben Jore" <twists@gmail.com> wrote:
>
> That only works as long as your '1' hasn't been rewritten as an
> overloaded literal.
>
>    use bigint;
>    eval {
>        ...
>        1; # secretly, an object which will have ->
>    } or ...;
>
> There's really nothing you can count on.

Yes, but 1 would still be true in that case.  If the literal 1 cannot be
counted on to be true, then lots if other assumptions are going to break as
well.  People who muck about with constants are responsible for ensuring
their code still works.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About