We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ed1f13 commit 28c9941Copy full SHA for 28c9941
_overviews/scala3-book/collections-methods.md
@@ -280,9 +280,11 @@ val x :: xs = names
280
281
Putting that code in the REPL shows that `x` is assigned to the head of the list, and `xs` is assigned to the tail:
282
283
+```scala
284
scala> val x :: xs = names
285
val x: String = adam
286
val xs: List[String] = List(brandy, chris, david)
287
+```
288
289
Pattern matching like this is useful in many situations, such as writing a `sum` method using recursion:
290
0 commit comments