This evening was time for our monthly
Functional Kats {Belfast} (<-- shameless plug) event that a buddy and I organise. It's in partnership with our namesake group down in Dublin and we usually connect with them over Skype for a group exercise, or watch a presentation if they have one on. Tonight we had connectivity issues so went rogue with a fun Kata of our own. It was a good one, worthy of sharing. So here it is. Feel free to play along.
The challenge is to write a program that will take in some source code and classify the elements of the language. For example, given a snippet of this made up language as input:
Your program will yield the following output:
The exact format of the output can vary depending on your solution style, but in essence it must be an ordered list of key value pairs. The Functional Kats group adds a secondary stipulation that the solution be in a functional style, and we saw partial solutions in Clojure, Scala, Elixir, and Javascript.
You may use any language you wish, and use any programming paradigm you wish (functional, object oriented, whatever)