Last active
June 1, 2019 15:22
Star
You must be signed in to star a gist
Bizarre interaction between explict for loop variables and iterators
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
| sub wat ($n) { | |
| ($n .. 1).map: -> $m { say "uno: $m" } | |
| ($n .. 1).map: -> $m { say "dos: $m" } | |
| } | |
| for ^2 -> $m { say "|$m|"; wat($m) } # explicit for loop variable | |
| say ''; | |
| for ^2 { say "|$_|"; wat($_) } # implicit for loop variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment