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

Cheers,
Moritz

Reply via email to