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

Re: [perl #116925] document/publicize THINKFIRST

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
May 6, 2013 15:11
Subject:
Re: [perl #116925] document/publicize THINKFIRST
Message ID:
20130506151136.GO2216@iabyn.com
On Tue, Mar 26, 2013 at 05:13:22PM -0700, Father Chrysostomos via RT wrote:
> On Tue Mar 26 13:55:32 2013, rjbs wrote:
> > I have moved this from 5.18 to 5.20 blockers.
> > 
> > It sounds like this needs more than mere documentation, and we're not
> > going to gain much by
> > documenting it now, encouraging its uptake, then changing how one must
> > use it or its future
> > analogue.
> 
> Also, if I’m not mistaken, sv_force_normal *is* already in the API, so
> we don’t actually *need* to ‘expose’ SV_CHECK_THINKFIRST.

Also, since the thing that triggered this discussion originally was
"how to make it safe under COW to directly modify the SvPVX buffer", note
that SV_CHECK_THINKFIRST etc don't actually guarantee you a writeable
SvPVX; for that you need SvPV_force (which does the equivalent of
SV_CHECK_THINKFIRST, but then in addition converts a IV/NV/RV etc into an
equivalent string value).

Since SvPV_force is already API, and is already documented (since 2000 or
earlier) as "You want force if you are going to update the SvPVX
directly", I think that's enough to keep us going till 5.18.

See also my recent comments in ticket RT #116407 about improving the docs
for SvPV to make it clear you can't just trample on PVX, and need
SvPV_force instead.

-- 
Art is anything that has a label (especially if the label is "untitled 1")

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