lua-users home
lua-l archive

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


on 8/28/07 1:07 PM, Roberto Ierusalimschy at roberto@inf.puc-rio.br wrote:

>> While I understand the reasoning for making strings act like values with
>> respect to weak tables, it can be a problem when dealing with computed
>> strings. For example, I might want to cache SQL statements and their
>> compiled form for SQLite.
> 
> Is the compiled form a string too?

No. It's a userdata object.

I'm looking at using as a heuristic for caching that if some piece of code
is hanging onto the string, then it is likely to make the query again. On
the other hand, if there are no other references to the string, then it was
probably a one-off construction.

Mark