I\'ve just found out that it\'s possible not to use the sign of =
when defining a method in Scala.
def someMethod(a: Int) {
println(a)
println(\
Such method definition is called procedure
. It's a special syntax for Unit
-returning methods:
def someMethod(a: Int): Unit = {
println(a)
println("---------")
}
It's not a recommended syntax. Martin Odersky believes it was a bad decision to include this syntax. See Keynote - Scala with Style chapter 45.