lua-users home
lua-l archive

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

--- "Tim Royal (ArtSource)" <> wrote:
> Is there any facility that will let me make an independent copy of a
> table and all its nested tables (yes, I understand the circular
> reference problem that could occur, so I'll need to be careful).

You just write your own. Here's the basic idea (I'm sure users here have more sophisticated

function deep_copy (table)
  t = {}
  for k,v in table do
    if type(v) == 'table'
      v = deep_copy(v)
    t[k] = v
  return t

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!