On Fri, 28 Apr 2017 11:55:40 -0700, cookbook_...@yahoo.co.jp wrote:
> On Fri, 28 Apr 2017 11:41:36 -0700, cookbook_...@yahoo.co.jp wrote:
> > On Fri, 28 Apr 2017 10:40:49 -0700, c...@zoffix.com wrote:
> > > On Fri, 28 Apr 2017 09:36:52 -0700, cookbook_...@yahoo.co.jp wrote:
> > > > See the following result:
> > > >
> > > > $ perl6 -e '["1:0.470572470261861",
> > > > "2:0.579981821025709"]>>.split(":", :skip-empty).sort({ $^b[0]
> > > > <=>
> > > > $^a[0] }).perl.say;'
> > > > (Seq.new-consumed(), Seq.new-consumed()).Seq
> > > >
> > > >
> > > > I think if sort method cannot look (i.e. consume) a Nth-indexed
> > > > value
> > > > (e.g. $^b[0], $^b[1], ...) and this behavior is a specced one, it
> > > > should return a warning message.
> > > >
> > > >
> > > > $ perl6 --version
> > > > This is Rakudo version 2017.03-217-ge681498 built on MoarVM
> > > > version
> > > > 2017.03-115-ge8231a3
> > > > implementing Perl 6.c.
> > >
> > >
> > > Thank you for the report. This is now fixed.
> > >
> > > The Seqs aren't actually consumed; it was a bug in .perl wrongly
> > > saying they're consumed.
> > >
> > > Fix: https://github.com/rakudo/rakudo/commit/54f50956ad
> > > Test: https://github.com/perl6/roast/commit/7d4092d940
> >
> > Thanks for fixing a bug.
> >
> > However, if leaving out a .perl calling, the following example also
> > cause the issue in my environment:
> >
> > $ perl6 -e 'for ["1:0.470572470261861",
> > "2:0.579981821025709"]>>.split(":", :skip-empty).sort({ $^b[0] <=>
> > $^a[0] }) -> ($k,$v) { ($k,$v).say }'
> > Too few positionals passed; expected 2 arguments but got 0 in sub-
> > signature
> >   in block <unit> at -e line 1
> >
> > $ perl6 --version
> > This is Rakudo version 2017.03-217-ge681498 built on MoarVM version
> > 2017.03-115-ge8231a3
> > implementing Perl 6.c.
> 
> Sorry, please forget the above my post.
> I noticed that the above one has nothing to do with .sort and doesn't
> match the title of this issue.
> 
> $ perl6 -e 'for ((1, 2).Seq, (3, 4).Seq) -> ($k,$v) { ($k,$v).say; }'
> Too few positionals passed; expected 2 arguments but got 0 in sub-
> signature
>   in block <unit> at -e line 1

Thanks. That's fixed now as well.

Fix: https://github.com/rakudo/rakudo/commit/98e137b1fe
Tests: https://github.com/perl6/roast/commit/b218a1ac01 

Reply via email to