[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Strings as Keys in table
- From: Philippe Lhoste <PhiLho@...>
- Date: Tue, 05 Jun 2007 11:51:20 +0200
On 05/06/2007 11:21, Eva Schmidt wrote:
I have a table with tables inside indexed like that
My problem now is that even if the table index exists already it is not
found if the function is called for the second time - so every time the
function is called the table will be newly created.
Can you provide a small _functional_ example showing the problem?
So I think my problem is, that I have to index the table with the same
string object as before, not just with the same string.
No. What the Wiki says is that if you have the same string in two
different parts of a script, they share the same object, ie. they point
to the same internal buffer.
Does anybody have an idea how to realize that as smart as possible?
Maybe some kind of a hash table ...?
Lua already hashes strings, that's how it sees strings are the same.
-- (near) Paris -- France
-- -- -- -- -- -- -- -- -- -- -- -- -- --