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

Re: [perl #112126] Hash::Util export bug

Thread Previous | Thread Next
Nicholas Clark
May 8, 2012 04:27
Re: [perl #112126] Hash::Util export bug
Message ID:
On Sat, Apr 28, 2012 at 09:54:31PM -0500, Jesse Luehrs wrote:

> Which makes me wonder why SvREADONLY is exposed to perl-space at all.
> It's not like it even keeps Hash::Util from needing XS. Wouldn't it make
> things a lot easier to follow if Internals::SvREADONLY was removed in
> favor of just adding a few bits to ext/Hash-Util/Util.xs?

I think Hash::Util would be easier to read if it better encapsulated the
unfortunate fact that it overloads the use of SVf_READONLY to mean a locked
hash, by putting the relevant necessary C-level manipulation into one well-
named place in its XS code.

Yes, is (currently) using Internals::SvREADONLY(), but for the
"conventional" purpose (a read only scalar value). That's unfortunate. I
wonder how to fix that. I'm even wondering if it's actually necessary for to do that, or if it's just a "nice to have". (In that, nothing
relies on enforcement of not being able to manipulate references in the
symbol table. It's not like it can't be worked round)

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About