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

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

Thread Previous | Thread Next
Moritz Lenz
March 23, 2010 06:04
Re: Something about the cascade calling of sort() in rakudo.
Message ID:

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

> 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 list, where they are more on topic.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About