data structures - How to create the equivalent of a HashMap<Int, Int[]> in Lua -


I have a simple data structure in Liau like Java Harmonic Symmetry.

The objective is that I want to map a unique key 'userID' against a set of two values ​​that are constantly updated, for example;

  '77777', {254, 24992}  

Any suggestions how can I get it?


  - Individual aggregation local dictionary =? - Other locales for the local zodiac = 0 local zodiac = 0 local matches = redis.call_ (key, query), key in ipairs (matches) local val = redis.call (gET, key) local count, size = val: Match ([^:] +): ([^:] +)) Top user (string sub. (Key, 11, 15), equation, zodiac sign) - Global calculation and size for query sumcount = sumCount + tonumber (Calculated) sumSize = sumSize + tonumber (size) end local result = string.format (% s:% s, sumcount, sumSize) returns results; - User Total Data Aggregation Function Top User () - Make the amount for each user's end  

< P> Believing that dictionary about what you are asking:

  local dictionary = {['77777'] = {254, 24992}, ['88888'] = {253 , 24991}, ['99999'] = {252, 2490},}  

The hard part is that the key is a string that can not be converted into the Loo convertible name So that you have each key [] I do not get a clear explanation of the rule for this, but it says that if a key is "underscores, letters and numbers, but do not begin with numbers" then for [] If defined above, otherwise square brackets are required.


Comments