-
-
Save Ovid/92ba0af93988f2c6e560 to your computer and use it in GitHub Desktop.
Why always in the same order?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @promises = gather for 2000, 4000, 5, 100 -> $nth { | |
take start { (1..Inf).grep(*.is-prime)[$nth] }; | |
} | |
.say for await @promises; | |
# Takes 15 seconds and always in the same order. | |
# 17393 | |
# 37831 | |
# 13 | |
# 547 |
zengargoyle
commented
Oct 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment