It's been a while

 I don't put the effort into this that I thought I would.  Regardless, I thought I would just say "out loud" that I think Elix...

January 22, 2020

A real quick Scala tip

For my purposes of learning Scala, I generally want to follow the compile, then run model. I didn't want to get into a whole IDE, so I'm still using vim and doing this from the command line. For this to work, however, I needed to extend App, like this:

The key bits are to extend App, and the name you use for the object must be used when running it. So you could name it calc, but then you must also run it with "scala calc", not "scala Calc".

This allows you to catch typos with the compiler and do some simple testing with the asserts. Later, I'll figure out how to integrate a test suite, but not today.

No comments:

Post a Comment