RosettaCodeData/Task/Multiple-distinct-objects/Groovy/multiple-distinct-objects-2.groovy

3 lines
98 B
Groovy
Raw Permalink Normal View History

2014-01-17 05:32:22 +00:00
// Following fails, creates n references to same object
def createFoos2 = {n -> [new Foo()] * n }