t"><p><code>Vec</code> is an immutable container for 1D homogeneous data (a &quot;vector&quot;). It is
backed by an array and indexed from 0 to length - 1.</p><p>Several element access methods are provided.</p><p>The <code>apply()</code> method returns a slice of the original vector:</p><pre><span class="kw">val</span> v = Vec(<span class="num">1</span>,<span class="num">2</span>,<span class="num">3</span>,<span class="num">4</span>)
v(<span class="num">0</span>) == Vec(<span class="num">1</span>)
v(<span c