groovy语法参考:https://www.bootwiki.com/groovy/groovy-overview.html
数值类型参考:https://www.bootwiki.com/groovy/groovy-round.html
在线运行:https://www.bejson.com/runcode/groovy/
demo
def l = [1,2,3,4]
for(int i=0;i<l.size();i++){
l[i] = l[i] + 1;
println(l[i])
}
输出
2
3
4
5