Skip to content

Commit

Permalink
remove ref to sbt in exercise w10
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornregnell committed Jun 25, 2024
1 parent c2ea3b4 commit a8b98e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compendium/modules/w10-inheritance-exercise.tex
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
\label{snake:fig:pairs-uml}
\end{figure}

\Subtask Öppna en editor och koda \code{trait Pair[T]} i en fil \code{pairs.scala}. Lägg dessutom till en konkret metod \code{tuple} i \code{Pair[T]} som returnerar en 2-tupel med de båda elementen i paret, så att det vid behov går att omvandla \code{Pair}-instanser till 2-tupler. Använd REPL via \code{sbt console} för att testa att detta fungerar:
\Subtask Öppna en editor och koda \code{trait Pair[T]} i en fil \code{pairs.scala}. Lägg dessutom till en konkret metod \code{tuple} i \code{Pair[T]} som returnerar en 2-tupel med de båda elementen i paret, så att det vid behov går att omvandla \code{Pair}-instanser till 2-tupler. Använd REPL för att testa att detta fungerar:
\begin{REPLnonum}
scala> val p = new Pair[Int] { val x = 10; val y = 20 }
p: Pair[Int]{val x: Int; val y: Int} = $anon$1@784223e9
Expand Down

0 comments on commit a8b98e1

Please sign in to comment.