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.
For my listening pleasure
Listening to podcasts has really grown on me over the last few years. Now that I'm working from home full time due to the Covid-19 pand...

Subscribe to:
Post Comments (Atom)
-
I previously wrote about switching my learning efforts from Haskell to Scala. I've switched back. ;) It was a combination of things. ...
-
So, I'm going about my day when I see this come across Twitter. So I go and read it . Wow. Let's go through it. It opens with...
-
Ok, let's let the cat out of the bag, today I ran the following in my Cloud 9 workspace: rails new name-that-book Exciting isn't...

No comments:
Post a Comment