This commit is contained in:
2024-02-11 21:25:40 +01:00
parent e69dd43fea
commit 483d40da91
5 changed files with 6 additions and 3 deletions

View File

@@ -3,7 +3,10 @@ package P10
object Curry {
def main(args: Array[String]): Unit = {
val curriedSum: Double => Double => Double => Double => Double = a => b => c => d => a+b+c+d
val curSum2 = curriedSum(1)(2)
print(curSum2(3)(4))
def currieSum2(a:Int)(b:Int): Int => Int => Int = (x:Int)=>(y:Int) => a+b+x+y
val curFunc = curriedSum(1)(2)
val curFunc2 = currieSum2(1)(2)
println(curFunc(3)(4))
println(curFunc2(3)(4))
}
}

View File

@@ -74,7 +74,7 @@ class Gabel {
return true;
}
public synchronized void place(String name){
System.out.println(name+" hat Gabel "+id+" zuruckgelegt");
System.out.println(name+" hat Gabel "+id+" zuruckgelegt");
takable = true;
}
}