SplitScript reference / Language / array rest pattern
array rest pattern
syntax
[prefix, .., suffix]
Matches a variable-length middle of an array.
Inside an array match pattern, .. matches zero or more elements between the explicit prefix and suffix. There may be at most one rest marker. It does not bind or copy the skipped elements. [first, ..] matches every nonempty array, [.., last] matches from the end, and [..] matches every length. Exact patterns without .. still require exactly their written length. For [T; N], the compiler checks that the explicit prefix and suffix fit in N; for growable [T], the runtime checks the minimum length before reading either side.
Examples
Match an array prefix and suffix
return match bytes {
[0x53, .., 0] => true,
_ => false,
}