This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def doWith(x,c) { | |
c.call() | |
} | |
def param = { i-> | |
println "## Params $i" | |
} | |
def noparam = { | |
println "#### No params" | |
} | |
doWith(4, {param "asdfasdf"}) | |
doWith(5,noparam) |
## Params asdfasdf #### No paramsIf you choose to pass a closure that requires paramaters then one would need o sourround the closure in curly brackets
doWith(4, {param "asdfasdf"})Otherwise
doWith(5,noparam)