Rich Oliver
Rich Oliver

Reputation: 6109

Scala match syntax: What is the block like structure

What is the structure delineated by curly brackets in a pattern match expression. It seems to be neither a Block nor a Template.

Upvotes: 0

Views: 137

Answers (1)

som-snytt
som-snytt

Reputation: 39577

Reflecting a bit on the question,

http://www.scala-lang.org/api/2.11.1/scala-reflect/#scala.reflect.api.Trees$MatchExtractor

the API also just calls them "cases".

The spec doesn't have a special name for it:

http://www.scala-lang.org/files/archive/spec/2.11/08-pattern-matching.html#pattern-matching-expressions

Maybe there is a more theoretical name for the patterns against which a match is performed.

Upvotes: 2

Related Questions