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

Re: mauve::reftype()

Thread Previous | Thread Next
David Golden
August 29, 2010 18:59
Re: mauve::reftype()
Message ID:
On Sun, Aug 29, 2010 at 6:57 PM, demerphq <> wrote:
> I have pushed a patch to add "fixed" versions of reftype, refaddr and
> blessed to universal.c, additionally
> at jesse's request this includes weaken() (and its relative isweak).
> I used the namespace "mauve" for now.
> I think the namespace should either be 'ref' or 'scalar'.

I'm late to the debate, but on the nitpicky issue of namespace, I
would have preferred you just picked one instead of a fake one.  A
fake one guarantees we have to change it.  A plausible one stands a
chance of not changing.

Without supporting the idea itself, I mildly prefer "scalar" because I
associate such functions with Scalar::Util already, though I have
slight reservations about "scalar" because of autobox and confusion
(overlap?) with SCALAR.

More generally, I question the benefit (wisdom) of jamming things into
universal.c.  Why not fix Scalar::Util?  Why not make them proper
keywords protected by 'feature'?

Adding new universal namespaces seems like just another kludgy way of
enhancing the core without breaking backwards compatibility and we
already have the feature kludge for that.

After considering it briefly, I think that if "everyone needs them",
then they should be keywords under feature.  If not, then they should
be in a module and Scalar::Util should just be fixed.  If it varies by
function, then split them up accordingly.

FWIW, I've always thought that blessed and weaken should be core
keywords.  The others strike me as more specialized functions that
could just live in a fixed Scalar::Util and imported when needed.

> Somewhat related to this I pushed a commit that checks that git
> ls-files and MANIFEST agree so that newly added files aren't left out
> of the MANIFEST.

demerphq += $big_number;

I finally made a git hook for myself so I would stop doing that.  More
safety checks like that for everyone are great.

-- David

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