| 
         | 
    ||
        
  | 
    
| 
  
  
    Hi Frank and Dirk, just as a question, and this is just academic, ok, no offense to anybody but for the slim chance of finding a nugget by coincidence, as anybody will concede could always be the case. Anybody bored by the topic, please forgive the vanity: On 1/10/11 6:45 PM, Frank Siebenlist wrote (thread 'Definition of table.insert'): I believe that if we manage to separate the map and array metaphors of a lua-table, then we can live with nil for the array-personality. At the current state of the discussion in "Definition of table.insert" do you think we could possibly clarify the metaphor for tables, not as it is but as it could be, 'should' be maybe 
 Just off the top of my hat, stuff like: 1 - a table is easy to understand and use and can be use as anything, a map, a list, an array 2 - all operators & functions working predictably the same, no matter the contents and history of the table --> constructors with nil in it don't break anything --> constructors with trailing nils don't break anything --> it doesn't matter whether it's kicked in with 0 or 1 (??) --> it can have negative keys 3 - stuff that does not make sense / could rarely be useful / is most likely unintended* -> throws an error 4 - Functions that should always work are: a. count = number of elements? b. size = highest numeric element (R!?) c. maxkey = highest key when sorted alphanumerically? d. maxvalue = highest value when sorted alphanumerically? ... This is really just to illustrate the question, not my full answer. I would like to find a very simple definition actually, brief and clear. After that, one could talk about implementation, or concrete, coherent proposals for changes to implementation maybe. It should be kept in mind that the table is the Swiss Army Knife of Lua and as far as I saw is used for all the stuff going on 'underneath', too, which made a good deal of Lua's elegance. So respect is in order. But may be not too much. Thanks, Henning *) yes don't preguess, but don't invite errors either. On 1/11/11 9:30 AM, Dirk Laurie wrote (thread Definition of table.insert): On Tue, Jan 11, 2011 at 09:05:12AM +0200, Henning Diedrich wrote:You also stress by that, that table must not be seen as one type, but two in one. I would suggest that's also too complicated. A table should not behave differently depending on how it has been treated before. Simple as that in my eyes. -- *Henning Diedrich* CEO Eonblast Corporation h...@eonblast.com +1.404.418.5002 www.eonblast.com This email contains confidential and/or privileged information. If you are not the intended recipient (or have received this email in error) please notify the sender immediately and destroy this email. Any unauthorized copying, disclosure or distribution of the material in this email is prohibited.  |