[Groovy] List里的Inject方法 inject是一个累积的过程,比方说实现从1到9的累加 def result = (1..9).inject(0){ sum , i -> sum += i } print result