lua-users home
lua-l archive

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


On Jul 31, 2014, at 12:30 PM, Rena <hyperhacker@gmail.com> wrote:

> On Thu, Jul 31, 2014 at 3:08 PM, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> wrote:
> 
> i.e. given a table, return a shallow copy of it. While this isn't
> quite the same operation, I do think table.copy should return a2 (or
> a1, if a2 isn't provided) for simplicity's sake, and the defaults for
> f, e, t ought to be 1, #a1, 1. Then you would be able to write:
> myCopy = table.copy(myTable, {}) --copy into an empty table and return it
> 

Pretty easy to create a tiny wrapper function that does this.

—Tim