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

September 2025

S M T W T F S
 1 2345 6
78 9 10 111213
14 151617 181920
212223 24252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 24th, 2025 08:35 am
Powered by Dreamwidth Studios