Skip to content

Instantly share code, notes, and snippets.

@Villane
Created February 18, 2012 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Villane/1859745 to your computer and use it in GitHub Desktop.
Save Villane/1859745 to your computer and use it in GitHub Desktop.
Hmm... what if Numeric types had an apply method
//Just had an idea. What if numeric types such as Int and Float had an apply method.
implicit def juxtaposition_int(x: Int) = new {
def apply(y: Int) = x * y
}
2 ( 1 + 1 ) == 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment