I just got a taste of some pattern matching in Scala. It was not really like what I had scene in Elixir or Haskell, but seems straight forward enough. In this case we match on some String attributes:
What made it slightly awkward, I guess, was the have to explicitly use the "match" keyword to say "I'm going to match here", but use the full class name and attributes. I guess it is just a bit "weird" to my eyes. There very well may be slicker ways to do this when I get into the more "hard core" FP techniques that I assume I will see in this book (or another).
All in all, I'm still enjoying Scala and this is just another thing to file away in the Scala portion of my brain.
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)
-
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...
-
I just got a taste of some pattern matching in Scala. It was not really like what I had scene in Elixir or Haskell, but seems straight forw...
-
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