On Sun, Sep 04, 2005 at 00:27:39 +1000, Stuart Cook wrote: > if &foo.accepts(:pos(1..3) :named<foo bar> :code) { ... }
I prefer this api... Arity is ambiguous will multiply variadic args. We have any number of positionals, nameds, and zero, one or two slurpies. > None of this really answers the question "What should &foo.arity > return?", but my point is that most of the time you probably shouldn't > be calling it yourself anyway. Better to tell the sub what you > actually intend to do, and let it make up its own mind (via its > Signature(s)). Yep > > To get the arity you must tell it which variant yyou mean, either by > > providing enough of the prototype, eg > > > > &foo(Any).arity vs foo(Any, Any).arity > > Unfortunately, that particular syntax is going to end up *calling* > &foo (unless of course you make .arity a special form). There was a syntax to disambiguate multis to .assuming... I meant that. -- () Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418 perl hacker & /\ kung foo master: /me sushi-spin-kicks : neeyah!!!!!!!!!!!!!!!!!!!!
pgp9k4RLcccOp.pgp
Description: PGP signature