0

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

Rich Oliver
  • 6,001
  • 4
  • 34
  • 57
  • 1
    It is a partial function. Consult http://stackoverflow.com/q/8650549/2684760 for further information. – ForNeVeR Jul 13 '14 at 15:00
  • 2
    It's a bunch of cases in the grammar. http://www.scala-lang.org/files/archive/spec/2.11/08-pattern-matching.html#pattern-matching-expressions – som-snytt Jul 13 '14 at 16:06

1 Answers1

2

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.

Marek J
  • 1,364
  • 8
  • 18
  • 33
som-snytt
  • 39,429
  • 2
  • 47
  • 129