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:
David Golden
Date:
December 19, 2015 03:49
Subject:
Re: Proposal: Add {-as => 'new_name'} feature to Exporter.pm
Message ID:
CAOeq1c_o5TYjx5dLRBXLJH_yMzxLaC4=26Bnoh6ZezZe4CCyMQ@mail.gmail.com
On Fri, Dec 18, 2015 at 10:29 PM, Kent Fredric <kentfredric@gmail.com>
wrote:

>
> I was under the impression that as-is, in case 3b, you're not "stuck",
> because the feature is available whether or not that module does
> anything.


I said that's conceptually equivalent to monkey patching.  By depending on
an old (possibly unconstrainted) version of Exporter, that module only
promises to respect string values passed to import.  If you upgrade
Exporter in a way that allows something else, you've changed it's contract
with you.  If the module ever wraps import() for any reason and your code
breaks, it's your fault.

If the argument is "I plan to use 5.24, so I want this whenever I can have
it, and I'll work around breakage if/when they happen" that's quite
different than the case I was describing and someone ought to go through
pros/cons of that.

David



-- 
David Golden <xdg@xdg.me> Twitter/IRC/Github: @xdg

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