Created
February 18, 2012 15:16
-
-
Save Villane/1859745 to your computer and use it in GitHub Desktop.
Hmm... what if Numeric types had an apply method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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