Seite 1 von 1

Content of Friday's lecture

Verfasst: 16. Mai 2015 17:05
von tahir
Last lecture's slides are not available online. Please upload the slides.

Also, is it possible to share the example code from last lecture ?

Thanks,
Tahir

Re: Content of Friday's lecture

Verfasst: 16. Mai 2015 20:19
von eichberg
Everything is now online. Sorry about the delay! I apologize for the inconveniences caused.

Re: Content of Friday's lecture

Verfasst: 16. Mai 2015 20:21
von eichberg
Usage of the Scala REPL

Code: Alles auswählen

scala> val l = 121 :: 2323 :: 23 :: Nil
l: List[Int] = List(121, 2323, 23)

scala> val x :: y :: _ = l
x: Int = 121
y: Int = 2323

scala> l match { case x :: y :: z :: Nil => true; case _ => false}
res0: Boolean = true

scala> l match { case x :: y :: Nil => true; case _ => false}
res1: Boolean = false

scala> val l = 121 :: 2323 :: 23.2d :: Nil
l: List[AnyVal] = List(121, 2323, 23.2)

scala> val x :: y :: z ::  _ = l
x: AnyVal = 121
y: AnyVal = 2323
z: AnyVal = 23.2
= 23.2

Re: Content of Friday's lecture

Verfasst: 16. Mai 2015 21:56
von tahir
thank you Dr. Eichberg.