Skip to content

Commit

Permalink
Remove misleading example
Browse files Browse the repository at this point in the history
While the example is interesting in that it shows an example of advanced pattern matching, it is problematic in that the pattern used is not of a valid type for the rest of the code.

As it is not really relevant to the issue at hand, and given that it's a relatively advanced example not likely to be relevant to someone first learning the language, I suggest simply removing it. A separate section on advanced pattern matching could potentially cover it.

Fixes scala-exercises#34
  • Loading branch information
erikwright authored May 2, 2019
1 parent 6d8c9fa commit dd00a51
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/scala/scalatutorial/sections/StandardLibrary.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ object StandardLibrary extends ScalaTutorialSection {
* // Same as `x :: Nil`
* case List(x) => …
* // The empty list, same as `Nil`
* case List() =>
* // A list that contains as only element another list that starts with `2`
* case List(2 :: xs) => …
* case List() => …
* }
* }}}
*
Expand Down

0 comments on commit dd00a51

Please sign in to comment.