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

Re: Proposal: Add {-as => 'new_name'} feature to Exporter.pm

Thread Previous | Thread Next
From:
Chad Granum
Date:
December 17, 2015 22:58
Subject:
Re: Proposal: Add {-as => 'new_name'} feature to Exporter.pm
Message ID:
CAJFr3ktZOKOmOkxmxdF2QvfVv-gvZL6Tj=D_9j4YsXN4U+7-jA@mail.gmail.com
No sooner did I send that then I realize did could do it better with 1 less
loop. Will attach new patch shortly.

-Chad

On Thu, Dec 17, 2015 at 2:55 PM, Chad Granum <exodist7@gmail.com> wrote:

> I actually decided to see just how hard it would be to write such a patch.
> I have attached a first go at it. No tests in the patch (though I tested it
> with a script). and I did not run any perl tests.
>
> Depending on the outcome of the discussion I may submit it to p5p with
> proper testing in place. But there is now a proof of concept :-)
>
> On Thu, Dec 17, 2015 at 12:51 PM, Chad Granum <exodist7@gmail.com> wrote:
>
>> Several modern export tools such as Sub::Exporter and Exporter::Declare
>> make it possible to rename subs that you import. They tend to use a
>> consistent syntax:
>>
>> use Foo 'export_name' => {-as => 'new_name'};
>>
>>
>> As of yet Exporter.pm has no such capability.
>>
>> 1) Would anyone be opposed to having this functionality added? (and why?)
>> 2) Does anyone oppose keeping the above syntax since it is consistent
>> with everything else?
>> 3) Are there any good technical reasons not to do this?
>>
>> Assuming there are no objections to the idea I would like to write a
>> patch (unless someone else wants to do it).
>>
>> -Chad
>>
>
>

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