Re:Kotlin: statically typed programming language that compil...
by meddlepal on Saturday December 29, 2012 @08:03PM
(#4984084)
I program in Groovy daily. "Groovy-style" builders are just sugar over the Builder pattern via heavy use of closures - so in reality they can be used anywhere an Object needs to be constructed.
So yea, any language which supports closures should be able to do "Groovy-style" builders.
Re:Kotlin: statically typed programming language that compil...
by bartonfink on Saturday December 29, 2012 @08:20PM
(#4984124)
Presumably because, among the languages (and standard libraries) you mentioned that have implemented this pattern, Groovy is the language that is most tightly associated with the JVM (which Kotlin is obviously targeting).
Re:Kotlin: statically typed programming language that compil...
by vorg on Saturday December 29, 2012 @08:30PM
(#4984156)
> Groovy is the language that is most tightly associated with the JVM
That could've been very true 6 years ago, when Groovy 1.0 was released, but I'd have to challenge that for 2012 (and 2013).
But doesn't Ruby also have those builders? Wouldn't it be easy enough for Scala to implement them in a library if they haven't already? Wouldn't Python also provide this type of syntax? E.g. a possible translation into Python from the Kotlin code on the linked page...
So what are they called "Groovy-style" builders for?