diff -r c45d3cd9a749 -r dcaab8068baa progs/lecture1.scala --- a/progs/lecture1.scala Sat Nov 04 16:17:19 2017 +0000 +++ b/progs/lecture1.scala Sun Nov 05 12:02:09 2017 +0000 @@ -13,6 +13,28 @@ // (you cannot reassign values: z = 9 will give an error) + +// Hello World +//============= + +// an example of a stand-alone scala file; +// in the coursework students must submit +// plain scala "work-sheets" + +object Hello extends App { + println("hello world") +} + +// can be called with +// +// $> scalac hello-world.scala +// $> scala Hello +// +// $> java -cp /usr/local/src/scala/lib/scala-library.jar:. Hello + + + + // Collections //============= List(1,2,3,1) @@ -126,24 +148,6 @@ val t = (4,1,2,3) t._4 -// Hello World -//============= - -// an example of a stand-alone scala file; -// in the coursework students must submit -// plain scala "work-sheets" - -object Hello extends App { - println("hello world") -} - -// can be called with -// -// $> scalac hello-world.scala -// $> scala Hello -// -// $> java -cp /usr/local/src/scala/lib/scala-library.jar:. Hello - // Function Definitions //======================