develooper Front page | perl.perl6.language | Postings from March 2010

Re: Something about the cascade calling of sort() in rakudo.

Thread Previous | Thread Next
From:
Moritz Lenz
Date:
March 23, 2010 06:04
Subject:
Re: Something about the cascade calling of sort() in rakudo.
Message ID:
4BA8BC3F.9030900@faui2k3.org
Hi,

Hongwen Qiu wrote:
> Hi, I'm new to Perl6. And just ran the first example in the perl6 book.
> But, it refused to work. It complains as follows:
> 
> Too many positional parameters passed; got 2 but expected between 0 and 1
> 
> I find out that the problem is in the line:
> 
> my @sorted = @names.sort({ %sets{$_} }).sort({ %games{$_} }).reverse;
> 
> And I tried eliminate the second sort, or just the parameters in the
> second sort. In both cases, it works.
> 
> So, why is this happen? Can it be a bug?

Yes. Thank you for your report.

Rakudo has gone through a major rewrite, and in that process some of the
features have temporarily disappeared. .sort() with a block accepting
just one parameter is one of these features.

So it works with some older versions of Rakudo (name the January
release), and we'll make sure it works in the Rakudo Star release in
2010-Q2.

> Sorry for my poor English. Hope you all understand what I'm trying to say.

Yes, it is quite good.

However in future please write about possible compiler errors to the
perl6-compilers@perl.org list, where they are more on topic.

Cheers,
Moritz

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