Skip to content

Instantly share code, notes, and snippets.

View animeshsrivastava24's full-sized avatar
👨‍🎓
Feeding my cravings of Open Source Contribution

Animesh Srivastava animeshsrivastava24

👨‍🎓
Feeding my cravings of Open Source Contribution
View GitHub Profile
@nicerobot
nicerobot / Story.scala
Created December 2, 2012 16:19
Simple Scala "DSL" example using easy to understand constructs.
object Story {
object Once { def upon = (x: a.type) => x }
object a { def time = (x: languages.type) => x }
object languages { def were = (x: inflexible.type) => x }
object inflexible { def along = (x: came.type) => x }
object came { def Scala = (x: inflexible.type) => x }
implicit def string(s : String) : inflexible.type = inflexible
def main(args: Array[String]): Unit = {
Once upon a time languages were inflexible; "Then " along came Scala ". The End!"