quote: Original post by Sneftel
I agree that the manual is confusing. One factor in this is how strings in Lua are stored; there's a global hash-table. So if you do
a = "foo"
b = "foo"
Then a and b actually point to the same location. The terminology is thus confusing, but the behavior is not; just treat every variable as a reference, and every datum as an object.
Ohh, this is interesting, hehe.
map1 = createmap()map2 = createmap()
So are you saying map1 and map2 point to the same location? My function (createmap()) creates a table, which holds the map's data, and returns it, by the way. Or were you just talking about strings? Well how about if I had something like this:
function createmap(idx) return { id = idx -- (The rest of the table here) }endmap1 = createmap(1)map2 = createmap(2)
My tables wouldn't be identical, so would be 2 seperate tables, right?
Thanks for that guys =)
[edited by - Ironica on July 22, 2003 10:16:34 PM]