updated
authorChristian Urban <urbanc@in.tum.de>
Tue, 05 Nov 2019 00:41:02 +0000
changeset 313 dea46bdfd648
parent 312 d8a15207114b
child 314 21b52310bd8b
updated
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 = {