Created
February 17, 2017 17:26
-
-
Save dos65/359058bd82cfd923b684540ad286d269 to your computer and use it in GitHub Desktop.
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
scala> val f = if (_:Boolean) (_:Int) else (_:Int) | |
f: (Boolean, Int, Int) => Int = <function3> | |
scala> f(false, 2, 3) | |
res27: Int = 3 | |
// почему в этом случае 2 аргумента и 2ой функция? | |
scala> val f2 = if (_:Boolean) (_:Int) + 1 else (_:Int) + 2 | |
f2: Boolean => (Int => Int) = <function1> | |
scala> f2(false)(3) | |
res28: Int = 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment