May. 11th, 2020

juan_gandhi: (Default)
Shakespeare, "Macbeth". Worth rereading, and again. And memorizing. Thrice.


juan_gandhi: (Default)
Welcome to Scala 2.12.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_92).
Type in expressions for evaluation. Or try :help.

scala> def f(x: Int) = 10 + x -> "ok"
f: (x: Int)(Int, String)

scala> f(10)
res0: (Int, String) = (20,ok)

scala> def g(x: Int) = 20 + x → "oops"
:11: error: overloaded method value + with alternatives:
  (x: Double)Double 
  (x: Float)Float 
  (x: Long)Long 
  (x: Int)Int 
  (x: Char)Int 
  (x: Short)Int 
  (x: Byte)Int 
  (x: String)String
 cannot be applied to ((Int, String))
       def g(x: Int) = 20 + x → "oops"
                          ^

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
2425 26272829 30
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 30th, 2025 10:11 pm
Powered by Dreamwidth Studios