News for hackers. Stuff that matters.
Re:G()('al') by pathikrit on Sunday July 27, 2014 @12:29AM (#8091987)
Quite trivial in idiomatic Scala:

  case class Goal(count: Int) {
    def apply() = Goal(count + 1)
    def apply(s: String) = s"g${"o" * count}$s"
  }

  object Goal {
    def g() = Goal(1)
  }

Non-idiomatic shorter answer:

  case class g(p: String = "go") {
    def apply() = g(p + "o")
    def apply(s: String = "o") = p + s
  }
Re:G()('al') by tolmasky on Sunday July 27, 2014 @12:35AM (#8091999)
This looks great! Can you submit a pull request? These things are coming in really fast and its way easier to take that way.
Re:G()('al') by stevenheidel on Sunday July 27, 2014 @12:44AM (#8092022)
Also add

g(s: String) = "gal"

to handle the case of no 'o's.