develooper Front page | perl.perl5.porters | Postings from January 2016

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

Thread Previous | Thread Next
From:
Kent Fredric
Date:
January 25, 2016 11:46
Subject:
Re: Proposal: Add {-as => 'new_name'} feature to Exporter.pm
Message ID:
CAATnKFAFSX5P3ET51rtkxAsP1MOeqSx6AQXYwULk_KXsFjKGnQ@mail.gmail.com
On 26 January 2016 at 00:35, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
>
> There is indeed a failure to separate concerns in Perl’s standard way of
> doing things, but going from “every module picks some exporter and its
> user gets no choice” to “every module cooperates with Importer and its
> user gets no choice” isn’t particularly much of a gain.


It does however mean that unlike Exporter.pm, where every additional
feature in the ->import() syntax affects every Exporter based module,
at a spooky distance, Importer.pm is only changing its own interface,
not the interface of every Exporter based module.

Foo -> Importer -> Thing -> Exporter

Here, "Importer" can by rights change its own interface without
changing the interface of "Thing"

Whereas:

Foo ->  Thing -> Exporter

Exporter changing anything changes the interface of "Thing" without
the consent of "Thing"


-- 
Kent

KENTNL - https://metacpan.org/author/KENTNL

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