From 23155d412602e2232e28239393fa8785558d6fd7 Mon Sep 17 00:00:00 2001 From: Andreas Roehler Date: Thu, 30 Nov 2023 11:10:22 +0100 Subject: [PATCH 1/2] #23, Exercise 2.1.7.1 honour comment, pattern-match on tuple Signed-off-by: Andreas Roehler --- chapter02/worksheets/solution2.1.7.1_AR.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter02/worksheets/solution2.1.7.1_AR.scala b/chapter02/worksheets/solution2.1.7.1_AR.scala index c39a2f0..8a3f29f 100644 --- a/chapter02/worksheets/solution2.1.7.1_AR.scala +++ b/chapter02/worksheets/solution2.1.7.1_AR.scala @@ -7,8 +7,8 @@ Exercise 2.1.7.1 */ val a = (0 to 9).flatMap(x => (0 to 9).map { y => (x, y) } ) -val b = a.map{ case x => x._1 + 4 * x._2 } -val c = a.map{ case x => x._1 * x._2 } +val b = a.map{ case (x, y) => x + 4 * y } +val c = a.map{ case (x, y) => x * y } val d = b.zip(c) val result = d.filter { case (x, y) => x > y } From f80d6eba50ddb16baa9905400cbd8d570a3173ca Mon Sep 17 00:00:00 2001 From: Andreas Roehler Date: Thu, 30 Nov 2023 11:24:14 +0100 Subject: [PATCH 2/2] Ignore Emacs auto-save files and RCS directories Signed-off-by: Andreas Roehler --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index d8bd0c4..3c5ec7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*~ +*RCS* *.class *.log