Lua table concatenation

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

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 4,097 Sep 23, 2006 07:45 AM
Last Post: stevejohnson