Hacker News new | ask | show | jobs
by virtualwhys 4119 days ago
Scala example is wrong, wouldn't even compile; should be:

    def blubExtra(a: Int, b: Int): Int = blub(inc(a), inc(b))
The original would need an equals thrown in there, otherwise it's procedural syntax (IIRC, has been deprecated or will be in the next release) which has a return type of Unit, thus not compiling when specifying a return type of Int.

    def blubExtra(a: Int, b: Int): Int = {
      blub(inc(a), inc(b))
    }
1 comments

Thanks for the typo spot. I've not written Scala for about 5 years. Unfortunately I can't go back and edit my post.