Scala variadic functions and Seq

Viewed 4329

As far as I know, traits like List or Seq are implemented in the Scala standard library instead of being part of the language itself.

There is one thing that I do not understand, though: one has a syntax for variadic functions that looks like

def foo(args: String*) = ...

Internally one has access to args and it will be a Seq.

It is not clear to me whether:

  • Seq is considered a special data structure enough to appear as part of the language, or
  • the * notation here is a particular case of a more general syntax that manages to avoid any references to concrete data structures interfaces.

Does anyone know which one is the correct intepretation?

2 Answers
Related