develooper Front page | perl.perl6.language | Postings from February 2004

Re: dynamic arguments (was: The Sort Problem)

Thread Previous | Thread Next
From:
Luke Palmer
Date:
February 12, 2004 20:43
Subject:
Re: dynamic arguments (was: The Sort Problem)
Message ID:
20040213044331.GA9570@babylonia.flatirons.org
Jonathan Lang writes:
> How about including something similar to <==, but which binds the elements
> of the list to the various positional parameters?  For instance: 
> 
>   @sorted = sort {infix:<=> args map {$_.foo('bar').compute}, $^a, $^b }
>             @unsorted; 
> 
> Where
> 
>   @x = $a, $b, $c; 
>   routine args @x; 
> 
> is equivelent to
> 
>   routine $a, $b, $c;

We already have that.  It's spelled:

    routine *@x;

Or

    routine * <== @x;

Luke

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About