From dccf096a64a4e34ccee572e01b2f8adf44e42531 Mon Sep 17 00:00:00 2001 From: valterbergstrand <112329564+valterbergstrand@users.noreply.github.com> Date: Fri, 30 Sep 2022 13:15:46 +0200 Subject: [PATCH] corrected a typo added `s` to make a string into a string polarization on line 197 --- slides/body/lect-w06-matching.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slides/body/lect-w06-matching.tex b/slides/body/lect-w06-matching.tex index 13b096595..4f100e837 100644 --- a/slides/body/lect-w06-matching.tex +++ b/slides/body/lect-w06-matching.tex @@ -194,7 +194,7 @@ case Gurka(v, false) => "gott, väger " + v case Gurka(_, true) => "inte gott" case Tomat(v, r) => (if r then "inte " else "") + s"gott, väger $v" - case _ => "okänd grönsak: $g" + case _ => s"okänd grönsak: $g" \end{Code} Konstruktormönster ''\Emph{plockar isär}'' det som matchas och binder variabler till de attribut som finns i case-klassens konstruktor.