Skip to content

Instantly share code, notes, and snippets.

@radsoc
Created May 8, 2014 07:48
Show Gist options
  • Save radsoc/13c599768aee38777bf3 to your computer and use it in GitHub Desktop.
Save radsoc/13c599768aee38777bf3 to your computer and use it in GitHub Desktop.
Proc chaining
var a = @["1", "2", "3", "4"]
a.map(proc(x: var string) = x &= "4") # OK
a.map(proc(x: var string) = x &= "2") # OK
a.map(proc(x: var string) = x &= "4")
.map(proc(x: var string) = x &= "2")# error: expression has no type (or is
# ambiguous)
echo a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment