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

October 2025

S M T W T F S
    1 23 4
5 678 9 1011
12 13 1415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 15th, 2025 03:05 am
Powered by Dreamwidth Studios