lua-users home
lua-l archive

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


On Dec 15, 2013, at 2:34 PM, Sir Pogsalot <sir.pogsalot@gmail.com> wrote:

> I could modify args_to_str() "deep-expand" tables in the call to a sequence of all values (including the hash part) in pairs() order.  SO args_to_str('a', { 'b', 'c', { 'd', 'e', 'f' } }, 'g') becomes '1|{2|3|{4|5|6}|7' and can be used to look up previous calls with similar table constructions (but not the same identity).  This isn't foolproof because userdata can act like tables as well…

Sounds like mission creep at this point. 

I personally prefer to just define a simple method to compute a signature, say tostring + type, and let the parameters sort it out between themselves what a stable, meaningful representation is.

As always, YMMV.