What the difference between the two def
s below
def someFun(x:String) { x.length }
AND
def someFun(x:String) = {
Note that the Scala Style guide always recommend using '=
', both in
Methods should be declared according to the following pattern:
def foo(bar: Baz): Bin = expr
Function types should be declared with a space between the parameter type, the arrow and the return type:
def foo(f: Int => String) = ...
def bar(f: (Boolean, Double) => List[String]) = ...