Skip Menu |
Report information
Id: 129797
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: gfldex <wenzel.peppmeyer [at] gmx.de>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
Subject: Channel.list does not honor .Slip
From: "Wenzel P. P. Peppmeyer" <wenzel.peppmeyer [...] gmx.de>
Date: Mon, 3 Oct 2016 14:16:39 +0200 (CEST)
Download (untitled) / with headers
text/plain 143b
my $c = Channel.new; $c.send((1,2,3).Slip); $c.close; dd (1,$c.list,2).join(':') # OUTPUT«"1:1 2 3:2"␤» # expected OUTPUT«"1:1:2:3:2"␤»
Date: Mon, 3 Oct 2016 15:30:50 +0200
To: "Wenzel Peppmeyer (via RT)" <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #129797] Channel.list does not honor .Slip
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Download (untitled) / with headers
text/plain 822b
Show quoted text
> On 03 Oct 2016, at 14:17, Wenzel Peppmeyer (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Wenzel Peppmeyer > # Please include the string: [perl #129797] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=129797 > > > > my $c = Channel.new; > $c.send((1,2,3).Slip); > $c.close; > dd (1,$c.list,2).join(':') > # OUTPUT«"1:1 2 3:2"␤» > # expected OUTPUT«"1:1:2:3:2"␤»
$ 6 'dd (1,(2,3,4),5).join(":")' "1:2 3 4:5” would you expect to give that 1:2:3:4:5 as well? I think the issue is clouded here by the stringification of a List: $ 6 'say (1,2,3).Str' 1 2 3 $ 6 'say ((1,2,3),).Str' 1 2 3 $ 6 'dd (1,2,3)' (1, 2, 3) $ 6 'dd ((1,2,3),)' ((1, 2, 3),) So I’m not sure there *is* a bug here. Liz
If you dump the data with `.perl`, you can see the middle item is a list with the slip in it: <ZoffixW> m: my $c = Channel.new; $c.send((1,2,3).Slip); $c.close; say (1,$c.list,2).perl <camelia> rakudo-moar 2a2f26: OUTPUT«(1, (slip(1, 2, 3),), 2)␤» <ZoffixW> m: my $c = Channel.new; $c.send((1,2,3).Slip); $c.close; say (1,||||||||||$c.list,2).perl <camelia> rakudo-moar 2a2f26: OUTPUT«(1, slip(1, 2, 3), 2)␤» <ZoffixW> m: my $c = Channel.new; $c.send((1,2,3).Slip); $c.close; say (1,$c.list,2).flat.perl <camelia> rakudo-moar 2a2f26: OUTPUT«(1, 1, 2, 3, 2).Seq␤» And I think the reported issue is that that doesn't correspond to the behaviour you'd get with a, say, hand-rolled sub doing the same thing, where the slip flattens automagically into an Array, but doesn't do so with the Channel's Queue object: <ZoffixW> m: sub foo ($x) { my @foo; @foo.push: $x; @foo.Seq.list }; dd (1, foo((2,3,4).Slip), 2).perl <camelia> rakudo-moar 2a2f26: OUTPUT«"(1, (2, 3, 4), 2)"␤» <ZoffixW> m: sub foo ($x) { my @foo; @foo.push: $x; @foo.Seq.list }; dd (1, |foo((2,3,4).Slip), 2).perl <camelia> rakudo-moar 2a2f26: OUTPUT«"(1, 2, 3, 4, 2)"␤» On Mon Oct 03 06:31:14 2016, elizabeth wrote: Show quoted text
> > On 03 Oct 2016, at 14:17, Wenzel Peppmeyer (via RT) <perl6-bugs- > > followup@perl.org> wrote: > > > > # New Ticket Created by Wenzel Peppmeyer > > # Please include the string: [perl #129797] > > # in the subject line of all future correspondence about this issue. > > # <URL: https://rt.perl.org/Ticket/Display.html?id=129797 > > > > > > > my $c = Channel.new; > > $c.send((1,2,3).Slip); > > $c.close; > > dd (1,$c.list,2).join(':') > > # OUTPUT«"1:1 2 3:2"␤» > > # expected OUTPUT«"1:1:2:3:2"␤»
> > $ 6 'dd (1,(2,3,4),5).join(":")' > "1:2 3 4:5” > > would you expect to give that 1:2:3:4:5 as well? > > > I think the issue is clouded here by the stringification of a List: > > $ 6 'say (1,2,3).Str' > 1 2 3 > > $ 6 'say ((1,2,3),).Str' > 1 2 3 > > $ 6 'dd (1,2,3)' > (1, 2, 3) > > $ 6 'dd ((1,2,3),)' > ((1, 2, 3),) > > So I’m not sure there *is* a bug here. > > > Liz


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org