Because semicolons, function return types, method arguments lists, and even the curly braces are sometimes omitted, using an equals sign prevents several possible parsing ambiguities.
因为分号,函数返回类型,方法参数列表,甚至大括号都经常会被省略,使用等于号可以避免几种可能的二义性。使用等于号也提醒了我们,即使是函数,在Scala里面也是值。
Because semicolons, function return types, method arguments lists, and even the curly braces are sometimes omitted, using an equals sign prevents several possible parsing ambiguities.
因为分号,函数返回类型,方法参数列表,甚至大括号都经常会被省略,使用等于号可以避免几种可能的二义性。使用等于号也提醒了我们,即使是函数,在Scala里面也是值。
应用推荐