Groovy: Closures
examples/groovy/dispatch_closures.gvy
def add = { x, y -> //println('add') return x+y } def multiply = { x, y -> //println('multiply') return x*y } def calc(a, b, f) { //println('calc') println(f(a, b)) } calc(4, 5, add) calc(4, 5, multiply)

Published on 2018-09-14
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post