Skip to content

Instantly share code, notes, and snippets.

@gustavoamigo
Created June 24, 2015 19:55
Show Gist options
  • Save gustavoamigo/9a0b2382fac99e45d69a to your computer and use it in GitHub Desktop.
Save gustavoamigo/9a0b2382fac99e45d69a to your computer and use it in GitHub Desktop.
Shakespeare with Dynamic Trait
// Fun with scala.Dynamic http://www.scala-lang.org/api/current/index.html#scala.Dynamic
case object MacBeth extends Dynamic {
def applyDynamic(method: String)(args: Any *) = {
println(s"$method")
MacBeth
}
}
MacBeth itIsATale() toldByAnIdiot() fullOfSoundAndFury() signifyingNothing()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment