Skip to content

Commit 28c9941

Browse files
authored
added ``` for a code snippet
1 parent 2ed1f13 commit 28c9941

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: _overviews/scala3-book/collections-methods.md

+2
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,11 @@ val x :: xs = names
280280

281281
Putting that code in the REPL shows that `x` is assigned to the head of the list, and `xs` is assigned to the tail:
282282

283+
```scala
283284
scala> val x :: xs = names
284285
val x: String = adam
285286
val xs: List[String] = List(brandy, chris, david)
287+
```
286288

287289
Pattern matching like this is useful in many situations, such as writing a `sum` method using recursion:
288290

0 commit comments

Comments
 (0)