Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created September 29, 2012 17:37
Show Gist options
  • Save joshcough/3804676 to your computer and use it in GitHub Desktop.
Save joshcough/3804676 to your computer and use it in GitHub Desktop.
// The hard way to create a Function object
new Function1[PlayerInteractEvent, Unit]{
def apply(e:PlayerInteractEvent): Unit = println(e)
}
// The easy way
(e:PlayerInteractEvent) => println(e)
// And in the right context, an even easier way
e => println(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment