> Unless I'm missing something here, you're not filling in the args correctly.
> I think you mean:
>
> $check = sub (;$$$$) {
> @_==0 ? __ < 2 + __ * atan($pi/__) or die __
> : @_==1 ? $_[0] < 2 + __ * atan($pi/__) or die __
> : @_==2 ? $_[0] < 2 + $_[1] * atan($pi/__) or die __
> : @_==3 ? $_[0] < 2 + $_[1] * atan($pi/$_[2]) or die __
> : $_[0] < 2 + $_[1] * atan($pi/$_[1]) or die $_[3]
> ;
> };
Yup. Cut-and-paste errors. Serves me right for posting at 3am. %-)
> > Arguments other than the last can also be bound by the explicit use of
> > placeholders:
>
> What do you mean 'other than the last'. Isn't your example showing that
> _all_ the arguments can get bound?
Sorry, what I meant was that, you can bind trailing arguments, just by omitting
them. Non-trailing arguments have to be bound explicitly with an __.
Damian
- RFC 23 (v1) Higher order functions Perl6 RFC Librarian
- Re: RFC 23 (v1) Higher order functions Ken Fox
- Re: RFC 23 (v1) Higher order functions Jeremy Howard
- Re: RFC 23 (v1) Higher order functions Ken Fox
- Re: RFC 23 (v1) Higher order function... Jeremy Howard
- Re: RFC 23 (v1) Higher order functions Damian Conway
- Re: RFC 23 (v1) Higher order functions John Porter
- Re: RFC 23 (v1) Higher order functions Damian Conway
- Re: RFC 23 (v1) Higher order functions Jeremy Howard
- Re: RFC 23 (v1) Higher order functions Glenn Linderman
- Re: RFC 23 (v1) Higher order functions Damian Conway
- Different higher-order func notation? (was Re... Nathan Wiger
- Re: Different higher-order func notation?... Jeremy Howard
- Re: Different higher-order func notat... Mike Pastore
- Re: Different higher-order func ... Nathan Wiger
- Re: Different higher-order f... Jeremy Howard
