RosettaCodeData/Task/Multiple-distinct-objects/Groovy/multiple-distinct-objects-2.groovy
2023-07-01 13:44:08 -04:00

2 lines
98 B
Groovy

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