Call a function: Difference between revisions

m
(→‎{{header|Groovy}}: Initial solution)
Line 1,643:
<lang groovy>def funcList = [func1, func2, func3]</lang>
** Use functions as arguments to other functions
<lang groovy>def eltChangeFunc = { it * 3 - 1 }</lang>
def changedList = list.collect(eltChangeFunc)</lang>
** Use functions as return values of other functions
<lang groovy>def funcMaker = { String s, int reps, boolean caps ->
Anonymous user