On Mon, Jan 12, 2009 at 12:11:59PM +0300, Richard Hainsworth wrote:
> But
> my @ranking = %players.sort :{.value}; # white space before :, no ws after :
>
> generates a syntax error with rakudo.
> Is this a raduko bug, or am I not understanding your generic argument?
Rakudo doesn't recognize adver
Larry Wall wrote:
On Sat, Jan 10, 2009 at 11:26:50PM +0300, Richard Hainsworth wrote:
More precisely, I dont understand the meaning of the ':' after '.sort'
It is turning the method call into a list operator, essentially.
It's not the so-called indirect object syntax, or it would be wr
On Sat, Jan 10, 2009 at 11:26:50PM +0300, Richard Hainsworth wrote:
> More precisely, I dont understand the meaning of the ':' after '.sort'
It is turning the method call into a list operator, essentially.
It's not the so-called indirect object syntax, or it would be written:
my @ranking = so
Richard Hainsworth wrote:
> Could someone help me understand what is going on in the following snippet?
>
> my %players = {'william'=>2, 'peter'=>3,'john'=>1,'mary'=>5};
> my @ranking = %players.sort: { .value };
> for @ranking {.say};
>
> I cut and pasted from Patrick's blog on sorting and playe
Hi!
> More precisely, I dont understand the meaning of the ':' after '.sort'
see line 1825 of S03
C<< infix:<:>>>, the invocant maker
...
ack (or grep) ': {}' in Spec dir can give a lot of examples.
ihrd
the first line creates a hash,
the second line sorts the hash values into an array.
the third loops thru the array values printing one array member per line
On Jan 10, 2009, at 2:26 PM, Richard Hainsworth wrote:
Could someone help me understand what is going on in the following
snippet?
my %p
On 2009 Jan 11, at 3:50, Richard Hainsworth wrote:
To be precise - why the ':' after the sort?
'%players.sort' calls the 'sort' method/sub on the hash '%players'.
'{.value}' runs '.value' on $_ at some point. But when?
So once again, what is the ':' doing? How else could this code be
writt
thanks for the response, but i was really looking for a bit more detail.
To be precise - why the ':' after the sort?
'%players.sort' calls the 'sort' method/sub on the hash '%players'.
'{.value}' runs '.value' on $_ at some point. But when?
So once again, what is the ':' doing? How else could