Luke Palmer wrote:
> 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
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, $
Jonathan Lang wrote:
> Luke Palmer wrote:
> > I've been thinking about this problem which comes up in my code a lot:
> >
> >@sorted = sort { $^a.foo('bar').compute <=> $^b.foo('bar').compute}
> > @unsorted;
> >
> > Often the expressions on each side are even longer than that.