[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Sorting in Lua Tables
- From: erik@... (Erik Hougaard)
- Date: Sun, Jan 23 2000 10:46:04 GMT+0100
How does Lua handle sorting in tables where indexing values are non-numeric?
x.x = "x"
x.b = "b"
x.h = "h"
if I do a 'print(next(x,nil))' I usually get 'b' but if a add
x.a = "a" then I still get b - if I then do a 'x=sort(x)' I still get 'b' - but this is not nessesary the truth. Some times it behaves completely different. If I look at the sort routines, the hash routines etc. It looks to me that handling of non-numeric index values are not very well supported!
I need a fixed behavior so my program wont display different sortings to the users.
Any comments to this ??