lua-users home
lua-l archive

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


> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br 
> [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of 
> leiradella@bigfoot.com
> Sent: Thursday, October 14, 2004 1:27 PM
> To: lua@bazar2.conectiva.com.br
> Subject: Re: Userdata with methods *and* table access.

> Depending on how many keys one have to compare and their 
> difference in length, gperf 
> (http://www.gnu.org/software/gperf/gperf.html) can also be a 
> good friend. 

 I was considering hashes, but doesn't Lua internally keep a hashed version
of the string?  Is there a way to get to that?  Or can I count on the const
char pointer returned from lua_tostring to be the same for the same strings
(this sounds really hacky)?  As it is now my innermost scripted loops are
doing string compares at the binding layer which makes them less efficient
than they could be with a good hash.

  Tom