HN user

jlh276

6 karma
Posts0
Comments2
View on HN
No posts found.

Get 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.

There are a number of syntactic errors and typos in the article. For instance `sum` should be:

* def sum(x: Int, y: Int) = x + y

Why `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...