class Test {
static def void function(int x, String y) {
println(x + " " + y)
}
}
class CurryExample {
def static void main(String[] args) {
val f1 = [Test.function(500,it)]
f1.apply("Str")
f1.apply("Second String")
}
}
@Data
class Test {
int v;
def void function(int x, String y) {
println(v + " " + x + " " + y)
}
}
class CurryExample {
def static void main(String[] args) {
val t = new Test(6)
val f1 = [int a,String b|t.function(a,b)]
val f2 = [f1.apply(500,it)]
f1.apply(100,"Two params with partially applied this")
f2.apply("Str")
f2.apply("Second String")
}
}