develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #119189] Bleadperl v5.19.2-276-g38be3d0 breaks LEONT/Const-Fast-0.014.tar.gz

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
August 22, 2013 15:36
Subject:
[perl #119189] Bleadperl v5.19.2-276-g38be3d0 breaks LEONT/Const-Fast-0.014.tar.gz
Message ID:
rt-3.6.HEAD-1873-1377185794-1429.119189-15-0@perl.org
On Thu Aug 22 04:14:44 2013, nicholas wrote:
> On Thu, Aug 22, 2013 at 12:57:22PM +0200, Leon Timmermans wrote:
> > On Wed, Aug 21, 2013 at 5:21 PM, Father Chrysostomos via RT <
> > perlbug-followup@perl.org> wrote:
> > 
> > > Suggestions?
> > >
> > 
> > Scalar::Util comes to mind, even if it can be used on non-scalars.
> 
> Possibly there ought to be a restriction to using it only on scalars.

That wouldn’t help Const::Fast, as the failures are precisely due to a
change in the way SvREADONLY(@a,1) works, for the sake of constant.pm.

> 
> Setting the "read only" flag can mean different things on the other types.
> It's (currently) used to mark restricted hashes, which aren't exactly
> read-only.
> 
> av.c suggests that arrays honour it, at least partially. Note, I don't
> trust arrays flagged READONLY to actually be immutable (given the
> contortions of the source) but I haven't actually found an exception. Yet.
> 
> Also, Scalar::Util already has a readonly() function to read it, but I'm
> not sure what "it" is. In that, part of the frustration is that the flag
> bit SVf_READONLY means a whole bunch of things, which might not always
have
> the semantics of "read only" that the programmer thought. It's not well
> defined. Or at least, not well specified.

Yeah, this whole area is a case in which people poke at the internals,
see what happens, go ‘Oh, neat!’, and then start writing tests and
depending on transient behaviour.

Until recently, perl would merrily modify read-only scalars at compile
time, so the read-only flag has not offered any real protection.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=119189

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