Lua table concatenation

Posts: 1,403
Joined: 2005.07
Post: #1
Does anyone know how to concatenate two table in lua
If I have
a = {frog="slimey", toad="warty"}
b = {cat="furry", fish="friendly"}
c = contab(a, b)
but Is there not a way to do it without defining contab?
Like a nice way.. Sad
function contab(a, b)
    local z = a
    for i in b do
        z[i] = b[i]
    return z

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  METAL (paths, random paths, and string concatenation) Mr Cozo 11 6,497 Sep 23, 2006 07:45 AM
Last Post: stevejohnson