Skip to content

Instantly share code, notes, and snippets.

@danveloper
Created December 20, 2012 16:32
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 danveloper/4346501 to your computer and use it in GitHub Desktop.
Save danveloper/4346501 to your computer and use it in GitHub Desktop.
Dynamic Method Parameters in Groovy
def bar(name) {
"bar: $name"
}
def foo(k, name = bar(k)) {
"$name"
}
assert foo("ha") == "bar: ha"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment