Skip to content

Instantly share code, notes, and snippets.

@fmamud
Forked from kdabir/vararg_closure.groovy
Last active March 28, 2016 21:23
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 fmamud/58fd3060b7f39345f6a6 to your computer and use it in GitHub Desktop.
Save fmamud/58fd3060b7f39345f6a6 to your computer and use it in GitHub Desktop.
Closures as Varargs in groovy
def hello (...c) {
c.each {it.call()}
}
hello ({println 'hello'},{println 'namaste'}, {println 'hola'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment