S11 stipulates:

* modules can decorate exports with tagsets

* module users are the ones who control which imports are allowed,
  and what scoping to give each import. The default is always lexical.

There are a few pieces missing in the puzzle, I think.

First, can a module not suggest a scope for the consumer? If a module
relies, for example, on setting up a 'state' variable in the caller, it
would be tedious for the caller to have to request that kind of var
every time. (If modules have no business demanding certain scopes from
their callers, why should the caller even have the standard way of
setting such scope?)

Second, where does a module consumer communicate configuration requests
to the module? In Perl 5, the 'use' arguments have often been used for
this purpose in an ad-hoc manner (e.g., 'use Test::More "no_plan"'),
and while I agree it's good to make this more regular, that shouldn't
mean it has to happen at runtime. Supposing there is an IMPORT hook we
can use, it needs some speccing so that we don't go ad-hoc all over
again. I don't have a proposal for how this would look like, but it
shouldn't conflate import directives (that say something about how the
caller sees the module) with other configurations (that say something
about the demands made by the caller to the module).


Reply via email to