Scala Named Function Arguments
Normally, function arguments are passed one by one in the order defined. But you can also specify argument names and pass them out of order, as shown below:
object Test {
def main(args: Array[String]) {
printInt(b=5, a=7);
}
def printInt( a:Int, b:Int ) = {
println("Value of a : " + a );
println("Value of b : " + b );
}
}
The output of the code above is:
$ scalac Test.scala
$ scala Test
Value of a : 7
Value of b : 5
Scala Functions