Scala Examples

Nice Stuff

Here I’ll post a few examples which I find show off some nice features of Scala and its syntax.

A nice example using anonymous functions, infix operators and more…

And output:

A fun thing to notice is that the Scala compiler introduces a new class definition (in a separate file!) for every anonymous function, and thus will blow up your desktop when you innocently try to compile this on top of it 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *