Skip to content

Instantly share code, notes, and snippets.

@ahoy-jon
Created October 13, 2012 14:00
Show Gist options
  • Save ahoy-jon/3884710 to your computer and use it in GitHub Desktop.
Save ahoy-jon/3884710 to your computer and use it in GitHub Desktop.
import language.dynamics
case class DynamicDuke(prefix:String = "") extends Dynamic {
def apply(s:String) = DynamicDuke(prefix + s)
def selectDynamic(method:String) = DynamicDuke(prefix + " " + method)
def applyDynamic(method:String) = selectDynamic(method)
}
val duke = DynamicDuke()
// ...
//Et certains diront que les possibilités sont infinies !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment