Skip to content

Instantly share code, notes, and snippets.

@thundergnat
Last active June 1, 2019 15:22
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 thundergnat/e14ca4f2486f3a2c0c6764a3f603ab5f to your computer and use it in GitHub Desktop.
Save thundergnat/e14ca4f2486f3a2c0c6764a3f603ab5f to your computer and use it in GitHub Desktop.
Bizarre interaction between explict for loop variables and iterators
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