diff -r d8a15207114b -r dea46bdfd648 progs/lecture1.scala --- a/progs/lecture1.scala Mon Nov 04 23:20:45 2019 +0000 +++ b/progs/lecture1.scala Tue Nov 05 00:41:02 2019 +0000 @@ -70,7 +70,10 @@ // this applies to "concrete" values...pretty much everything; -// but for example you cannot compare functions (later) +// but for example you cannot compare functions (later), +// and also not Arrays + +Array(1) == Array(1) // Printing/Strings @@ -80,8 +83,8 @@ val tst = "This is a " ++ "test" -print(tst) -println(tst) +print(tst) +println(tst) val lst = List(1,2,3,1) @@ -212,8 +215,9 @@ // // BTW: no returns!! -// "last" line (expression) in a function determines the result -// +// "last" line (expression) in a function determines the +// result + def silly(n: Int) : Int = { if (n < 10) n * n @@ -402,7 +406,8 @@ // - no mutable data-structures (no Arrays, no ListBuffers) // But what the heck.... -// Q: Count how many elements are in the intersections of two sets? +// Q: Count how many elements are in the intersections of +// two sets? // A; IMPROPER WAY (mutable counter) def count_intersection(A: Set[Int], B: Set[Int]) : Int = {