develooper Front page | perl.perl5.porters | Postings from December 2015

Re: A more CPANish way of making the prereq explicit? [was:Proposal: Add {-as => 'new_name'} feature to Exporter.pm]

Thread Previous
From:
Chad Granum
Date:
December 24, 2015 14:49
Subject:
Re: A more CPANish way of making the prereq explicit? [was:Proposal: Add {-as => 'new_name'} feature to Exporter.pm]
Message ID:
CAJFr3ku_8Lk2zPGBwKWQ09HQRLQ+BgHqxeePeW_CZLLhbO=N=Q@mail.gmail.com
1) Symbol::Rename is an experiment to scratch an itch. It should not be
considered a finished product, or stable code. MST and others have already
given me feedback that is likely to produce significant changes to the
module, least of which is a name change.

2) Even if Symbol::Rename is eventually a viable thing, it does not take
away the usefulness of adding the renaming feature to Exporter.pm

On Thu, Dec 24, 2015 at 1:20 AM, Kent Fredric <kentfredric@gmail.com> wrote:

> On 24 December 2015 at 21:48, Aristotle Pagaltzis <pagaltzis@gmx.de>
> wrote:
> > That said I do not love the name and welcome
> >> bike-shedding for a better one.
>
>
> I think Chads' other experiment,
> https://metacpan.org/pod/Symbol::Rename , is an appreciable compromise
> that doesn't require gut poking.
>
> Its essentially a nicer syntax for  doing
>
> use Foo ":group";
> BEGIN { *newname = *oldname; undef *oldname }
>
> Except without needing arcane understanding of what that's doing that
> confuses novices.
>
> use Foo ":group"
> use Symbol::Rename "oldname" => "newname";
>
> I think the only downside of this approach is it leaves very few open
> doors for a potential future that tracks imported symbols
> such that "no Foo" will clean itself up.
>
> At least with bolting it in exporter, exporter could potentially
> record a map of who it gave what symbols to so that it could nuke them
> again when its done.
>
> Then again, everyone uses namespace::autoclean anyway.
>
> --
> Kent
>
> KENTNL - https://metacpan.org/author/KENTNL
>

Thread Previous


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