Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created February 16, 2017 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/8bcc916ef3e683b8e6cd879a75ab4282 to your computer and use it in GitHub Desktop.
Save zoffixznet/8bcc916ef3e683b8e6cd879a75ab4282 to your computer and use it in GitHub Desktop.
{ await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.0270586712045023 0.50282175820546 0.707354057194074 0.752100587573688 0.0829717663297391 0.123633146861231 0.179592568473487 0.356994655520101 0.189361222617329)␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.167076433605776 0.0349799916655986 0.0182982819611563 0.127766425315563 0.822049526616873 0.0293809558024096 0.0422444366394594 0.276591628565282 0.857131125825115)␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.537240998136226 0.449116563705328 0.8924464906839 0.217715260075867 0.280746775958209 0.145050173060582 0.260705164499102 0.505029876646299 0.871794033916991)␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.0562057297051904 0.590175574809914 0.680104143999658 0.665644302668003 0.761657797788401 0.248624580968842 0.974119642170936 0.812472271440152 0.501827459886629)␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«This continuation has already been invoked␤ in block <unit> at <tmp> line 1␤␤»
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.255246738852002 0.0147451305708488 0.794780602619446 0.86926195071911 0.947034042741004 0.306729682031303 0.860752727883978 0.695647368725749 0.742955738680169)␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.863747412795859 1 0.0114168238540928 0.436762976395659 0.194220491934482 0.251039344210143 0.438531493244297 0.809980655138635 0.631455799106853)␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.961214600267968 1 0.846669549473049 0.788142623050832 0.909734734982077 0.52977352129484 0.762634431334782 0.272982438112118 0.745573199804918)␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«This continuation has already been invoked␤ in block <unit> at <tmp> line 1␤␤»
<ZoffixW> m: my $c = 0; my @a = lazy gather { take 1; loop { take rand } }; my @b = lazy gather { take 1; loop { take rand } }; for ^10 -> $i { await start { $ = @a[^$i] }, start { $ = @b[^$i] } }; say @a[^10] eqv @b[^10]; say $c; say @a[^10]
<camelia> rakudo-moar 8f53a6: OUTPUT«False␤0␤(1 0.990599436183488 0.285628380177695 0.654405676409599 0.659434009071907 0.121136940861081 0.062798558742484 0.00385580914193559 0.943609992080144 0.902272328153536)␤»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment