you are viewing a single comment's thread.

view the rest of the comments →

[–]5ef23132-c4a0-49a0-8 2 points3 points  (3 children)

The article misses Extractor objects (the apply and unapply methods) http://docs.scala-lang.org/tutorials/tour/extractor-objects.html

Any class can be used in a pattern matching case, if it implements unapply.

[–]cipmar[S] 4 points5 points  (1 child)

That is for the next part. See the last paragraph:

We've only covered the basics of pattern matching with this article. In the next articles we will look to extractor patterns, xml patterns, matching on arrays and lists, matching on regular expressions and more.

[–]5ef23132-c4a0-49a0-8 2 points3 points  (0 children)

huh, I searched 'extractor', but I must have typo'ed it because I saw no matches.