On Sunday 21 May 2006 03:03, Leopold Toetsch via RT wrote:

> Invocants are the first few *positional* arguments used for a function
> call, but certainly not arguments inside some kind of flattening
> container.
>
> Imagine you have instead of ...
>
> >     'foo'( args :flat )
> >     end
> > .end
> >
> > .sub 'foo' :multi(Integer)
>
> ... a :multi(int) / :multi(string). Due to autoboxing the native type
> needed for dispatch would be lost.
>
> Or - you have args with MAYBE_FLAT bit set and some slurpy and
> non-slurpy sub variants. Would it first dispatch based on the
> flattening aggregate, then again on the contents of it?

That's unfortunate.  I thought :flat was like the splatty behavior in Perl 6.

I can work around this for now with the C-like call_func1, call_func2, ... 
call_funcN, but Parrot ought to be more dynamic than C in just about all 
cases.

There ought to be a way to write the Perl 5-ish:

        sub just_pass_through
        {
                my @args = @_;
                some_other_func( @args );
        }

Perhaps another attribute on invocation, perhaps :splat or :splatty?

-- c

Reply via email to