Skip to content

Instantly share code, notes, and snippets.

@mvk
Created May 4, 2016 18:14
Show Gist options
  • Save mvk/ad65c6d83d586ba74bf8134929526328 to your computer and use it in GitHub Desktop.
Save mvk/ad65c6d83d586ba74bf8134929526328 to your computer and use it in GitHub Desktop.
def multiwrap(wrappers, body) {
def _multiwrap(wrappers, idx, body) {
if (idx == wrappers.size()) {
body()
} else {
wrap(wrappers.get(idx)) {
_multiwrap(wrappers, idx + 1, body)
}
}
}
_multiwrap(wrappers, 0, body)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment