Anonymous user
Call a function: Difference between revisions
m
→{{header|Groovy}}: fix typo
(→{{header|Groovy}}: Initial solution) |
m (→{{header|Groovy}}: fix typo) |
||
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 }
def changedList = list.collect(eltChangeFunc)</lang>
** Use functions as return values of other functions
<lang groovy>def funcMaker = { String s, int reps, boolean caps ->
|