Julia LanguageTuples


Syntax

  • a,
  • a, b
  • a, b = xs
  • ()
  • (a,)
  • (a, b)
  • (a, b...)
  • Tuple{T, U, V}
  • NTuple{N, T}
  • Tuple{T, U, Vararg{V}}

Remarks

Tuples have much better runtime performance than arrays for two reasons: their types are more precise, and their immutability allows them to be allocated on the stack instead of the heap. However, this more precise typing comes with both more compile-time overhead and more difficulty achieving type stability.