RosettaCodeData/Task/Multiple-distinct-objects/Groovy/multiple-distinct-objects-2.groovy
2014-01-17 05:34:36 +00:00

2 lines
98 B
Groovy

// Following fails, creates n references to same object
def createFoos2 = {n -> [new Foo()] * n }