jlh276·14 ปีที่แล้ว·discussGet some sleep, then spend another week playing with Scala and its REPL. It's a terrific tool to learn. If you like Eclipse, install the Scala IDE and the Scala Worksheet. It's rough around the edges, but it's even better than the REPL.
jlh276·14 ปีที่แล้ว·discussThere are a number of syntactic errors and typos in the article. For instance `sum` should be:* def sum(x: Int, y: Int) = x + yWhy `return x * y`? That is not a sum... Also using `return` is not idiomatic scala.* List(1, 2, 3) ::: List(4, 5, 6)That is the more typical way to concatenate lists. Using `+` will actually fail to compile.* list.map(i => i + 1)to increment the list. forall checks that a predicate is true for all elements.And so on...