Re: dynamic arguments (was: The Sort Problem)

2004-02-12 Thread Jonathan Lang
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

Re: dynamic arguments (was: The Sort Problem)

2004-02-12 Thread Luke Palmer
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, $

dynamic arguments (was: The Sort Problem)

2004-02-12 Thread Jonathan Lang
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.