Skip to content

Comment on DSL processing in Scala

Comments

I'm still a scala newbie, so any comments/suggestions are appreciated.

The full source code is here: https://gist.github.com/dpapathanasiou/b9d85685a0381f1deea0

Well done on posting this! it's a great way to learn and share your experience of learning new languages and get feedback. (just take the comments by face value without any sentiments, you should learn from them, not make them discourage you, ignore "my eyes are bleeding" type of comments or "Scala is sooo complexxx" unless they have some really constructive criticism in them...)

One tiny cosmetic suggestion that popped to my eyes since you asked for comments :)

    def parseInputRange (s: String): Array[Int] = {
      val ab = s.split(":").map(_.toInt)
      (ab(0) to ab(1)).toArray
    }
the `to` method is inclusive on the end of the range, so it is the same as until x + 1

Good luck!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.