On Sat, Mar 17, 2007 at 12:12:12PM -0700, Allison Randal via RT wrote:
> Jerry Gay (via RT) wrote:
> > ...an Exporter PMC that defines an api for
> > exporting.
> 
> Proposed interface:
> 
> $P0 = new Exporter
> $P0.import($P1, ['KeyTo'; 'ImportedNamespace'], $P2)
> 
> where $P1 is the current namespace, and $P2 is an array of sub names to
> import. 

Could we also do some multi-dispatch here or typechecking of $P2
so that it could also be a whitespace-separated string of subnames
to import?  Then instead of

    $P2 = split ' ', 'foo bar baz'
    $P0.'import'($P1, ['ImportedNameSpace'], $P2)

we could write 

    $P0.'import'($P1, ['KeyTo'; 'ImportedNamespace'], 'foo bar baz')

It also helps in the case where we only want to import a single
symbol.

> It'd be even better if we could have the method detect the
> namespace of its caller, rather than having to pass it in manually.

I believe there was a way to do this (using interpinfo), and
I agree that it would be much better.  And perhaps it could then
be an optional named parameter, so that we import into the
caller's namespace by default, but there's an option to
import to another explicit namespace.

Pm

Reply via email to