On Sat, Mar 17, 2007 at 06:16:08PM -0400, Will Coleda wrote:
> On Mar 17, 2007, at 4:37 PM, Patrick R. Michaud wrote:
> >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')
> >
> 
> Ok, but then how would import the sub, "foo bar baz"? ^_^

With:

    $P2 = new .ResizablePMCArray
    push $P2, 'foo bar baz'
    $P0.'import'($P1, ['KeyTo'; 'ImportedNamespace'], $P2)

Subs with spaces in the name are the rare case, so it's okay
if a PIR programmer has to do a little extra work for those.  :-)
And silicon-based PIR generators would likely be generating the
array anyway, or otherwise dealing with the case of a delimited
list of sub names.

Pm

Reply via email to