Created
April 7, 2018 10:16
-
-
Save k0pernicus/0870a3975091cbeac16b5ec9b27bc95d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # The following code is OK | |
| # WORKS | |
| proc my_proc(x: uint32) = | |
| echo x | |
| proc print_parallel_ok(r: uint32) = | |
| for x in 0..r: | |
| spawn my_proc x | |
| # Otherwise, passing an anonymous procedure to spawn throws an error | |
| # DOES NOT WORKS | |
| proc print_parallel_nok(r: uint32) = | |
| for x in 0..r: | |
| spawn (proc (x: uint32) = echo x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment