So Groovy has this relatively convenient syntax for converting methods to locks, for example.
[1,2,3].each { println it }
[1,2,3].each this.&println
But how to convert a Constructor class like
[1,2,3].collect { new Thing( it ) }
[1,2,3].collect ????
Groovy reflection has a Thing.constructorschecklist, but I can't figure out where to put the ampersand in Thing.constructors[0].
source
share