Skip to content

Instantly share code, notes, and snippets.

@ryo-murai
Created December 15, 2012 02:32
Show Gist options
  • Save ryo-murai/4290810 to your computer and use it in GitHub Desktop.
Save ryo-murai/4290810 to your computer and use it in GitHub Desktop.
List.metaClass.zipWithIndex = { ->
[delegate, (0 ..< delegate.size)].transpose()
}
['A', 'B', 'C'].zipWithIndex()
[[A, 0], [B, 1], [C, 2]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment