On Thu, 14 Sep 2017 13:30:46 -0700, timo wrote:
> I'm using two start blocks that return Slips to generate a long list in
> parallel, then i iterate over the result in the Moar Heap Analyzer.
> 
> Trying to take advantage of v6.d's nonblocking await gives me a change
> in semantics, though:
> 
>     use v6.d.PREVIEW;
>     use Test;
>     my @foo = do {
>         await start { do for ^2 { my uint64 @ = 9, 9; }.Slip },
>               start { do for ^2 { my uint64 @ = 1, 2; }.Slip };
>     };
>     is @foo.elems, 4, "slips awaited over get flattened out";
>     say @foo.perl
> 
>     # -> not ok 1 - slips awaited over get flattened out
>     # -> [slip(array[uint64].new(9, 9), array[uint64].new(9, 9)),
> slip(array[uint64].new(1, 2), array[uint64].new(1, 2))]
> 
>     use Test;
>     my @foo = do {
>         await start { do for ^2 { my uint64 @ = 9, 9; }.Slip },
>               start { do for ^2 { my uint64 @ = 1, 2; }.Slip };
>     };
>     is @foo.elems, 4, "slips awaited over get flattened out";
>     say @foo.perl
> 
>     # -> ok 1 - slips awaited over get flattened out
>     # -> [array[uint64].new(9, 9), array[uint64].new(9, 9),
> array[uint64].new(1, 2), array[uint64].new(1, 2)]

Fixed, and test coverage in S17-promise/nonblocking-await.t.

Reply via email to