Darren Duncan wrote:
> Here's a question:
>
> Say I had an N-adic routine where in OO terms the invocant is one of the N
> terms, and which of those is the invocant doesn't matter, and what we really
> want to have is the invocant automatically being a member of the input list.

How about allowing submethods to be declared outside of classes and
roles as well as inside them?  When declared inside a class or role,
it is declared in "has" scope, and works as described; when declared
elsewhere, it is declared in "my" scope, and works just like a sub,
except that you're forced to specify an invocant in the signature(s).
You could then use the same sort of tricks that subs can use to
specify alternate signatures, including the one that lets the
positional arguments be filled out in any order.

-- 
Jonathan "Dataweaver" Lang

Reply via email to