title: In Lua, how to get the tail of an array without copying it?
body: <p>I'm wokring with Lua 5.2, and for the sake of this question, assume that the tables are used exclusively as arrays.</p>
  
  <p>Here's a function that returns the <em>tail</em> of an array (the array minus its first element):</p>
  
  <pre><code>function tail(t)
  
     if # t &lt;= 1 then
        return nil
     end
  
     local newtable = {}
     for i, v in ipairs(t) do
        if i &gt; 1 then
            table.insert(newtable, v)
        end
     end
  
     return newtable
  end 
  </code></pre>
  
  <p>For instance:</p>
  
  <blockquote>
    <p>prompt> table.concat(tail({10, 23, 8}), ", ") </p>
    
    <p>23, 8</p>
  </blockquote>
  
  <p>However this is achieved by returning a new copy of the table. Is there a way to avoid the creation of a new table? </p>
  
  <p>I am looking for the equivalent of C's returning a pointer to the next element (<code>t++</code>). Is it possible?</p>