News for hackers. Stuff that matters.
Re:TOML, Tom's Own Markup Language by charlieok on Saturday February 23, 2013 @11:00PM (#5272737)
I agree with that. 'map' or 'dictionary' are the best choices I think (or 'associative array', but why bring arrays into it). That's the interface, of which a hash table is just one possible implementation.
Re:TOML, Tom's Own Markup Language by Myrmornis on Sunday February 24, 2013 @01:14AM (#5273108)
I've never liked 'dictionary'. The analogy isn't at all apparent to me. A dictionary explains what words means. The thing we're talking about doesn't explain what keys mean. (Someone who spends most of his time writing python here.) 'map' or 'mapping'.
Re:TOML, Tom's Own Markup Language by charlieok on Sunday February 24, 2013 @02:56AM (#5273345)
It's about the operations. One Does Not Simply (tm) read a dictionary. One instead performs a “lookup” for a particular item. The dictionary is designed to make this lookup fast and reliable, which matches the purpose of these data structures in software.
Re:TOML, Tom's Own Markup Language by SoftwareMaven on Sunday February 24, 2013 @01:37AM (#5273154)
A dictionary maps words to their definitions. The words are the keys, the definitions are the values. Seems reasonable to me. Though as another predominantly pythoner, I do prefer map as well.
Re:TOML, Tom's Own Markup Language by Myrmornis on Sunday February 24, 2013 @02:07AM (#5273214)
In a dictionary the value (meaning) is often (partially) implied by the key (word), by etymology etc. In the data structure there need be no relationship between the key and value other than the fact that they are a key-value pair in this instance. It introduces messy cultural concepts into what should be a clean, abstract concept.
Re:TOML, Tom's Own Markup Language by mmahemoff on Sunday February 24, 2013 @01:34AM (#5273145)
I think dictionary is a useful high-level analogy. Small key objects mapping to potentially large, and often structured, value objects. (By structure, I mean the definition in a dictionary often includes fields like pronunciation and origin.)
Re:TOML, Tom's Own Markup Language by aamar on Sunday February 24, 2013 @02:14AM (#5273229)
Sadly "map" is also the name of the critical "map" function which operates on lists. Maybe with an indefinite article ("a map") it's clear enough.
Re:TOML, Tom's Own Markup Language by dkersten on Sunday February 24, 2013 @07:40AM (#5273992)
Sure, so go the Lua route: table. Or the python route: dictionary. If neither of those do it for you, how about "mapping"?

Hash (and hash map, hash table etc) leak too much implementation detail. What if you want a tree-based mapping instead? I like how in C++ it's map (for ordered, rb-tree based maps) and unordered_map (for unordered, hash table based maps).

Re:TOML, Tom's Own Markup Language by aamar on Monday February 25, 2013 @10:59PM (#5283861)
I'm going to try out "mapping" -- good suggestion.