lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> But this can easily be done with a simple function, such as this naive
> example:
> 
>  function slice(t, s, e)
>    local r = {}
>    for i = s, e do
> 	r[#r+1] = t[i]
>    end
>    return unpack(r)
>  end

An easier implementation:

  slice = unpack

-- Roberto