In squirrel, is there an easy way to compare data structures?
An example is:
local data1 = {
"foo" : "bar",
"timestamps" : [1436983175, 1436984975, 1436986775, 1436988575, 1436990375],
"readings" : [32.5, 33.6, 32.8, 32.9, 32.5],
"otherData" : {
"state" : true,
"test" : "test"
}
}
local data2 = {
"foo" : "bar",
"timestamps" : [1436983175, 1436984975, 1436986775, 1436988575, 1436990375],
"readings" : [32.5, 33.6, 32.8, 32.9, 32.5],
"otherData" : {
"state" : true,
"test" : "test"
}
}
if(data1==data2) server.log("A match"); // would be too easy
I have tried serializer, json encoding and also converting to at string, but it doesn’t work. The data structure elements are not necessarily stored/converted in the same order.