Last active
August 29, 2015 14:07
-
-
Save wrobstory/28ce5fecb3a11dcea564 to your computer and use it in GitHub Desktop.
Higher Order Wat
This file contains hidden or 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
def add(x: Int, y: Int = 1): Int = x + y | |
def transform(z: Int, transformer: (Int, Int) => Int): Int = transformer(z) | |
// Exiting paste mode, now interpreting. | |
<console>:9: error: not enough arguments for method apply: (v1: Int, v2: Int)Int in trait Function2. | |
Unspecified value parameter v2. | |
def transform(z: Int, transformer: (Int, Int) => Int): Int = transformer(z) |
This file contains hidden or 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
scala> def add(x: Int = 1, y: Int = 2): Int = x + y | |
add: (x: Int, y: Int)Int | |
scala> add() | |
res0: Int = 3 | |
scala> def transform(z: Int, transformer: (Int, Int) => Int): Int = transformer() | |
<console>:7: error: not enough arguments for method apply: (v1: Int, v2: Int)Int in trait Function2. | |
Unspecified value parameters v1, v2. | |
def transform(z: Int, transformer: (Int, Int) => Int): Int = transformer() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment