Comparison of programming languages (associative array): Difference between revisions

Content deleted Content added
m C++: add link for unordered_map
Line 502:
 
Lists of pairs and functional maps both provide a purely functional interface. In contrast, hash tables provide an imperative interface. For many operations, hash tables are significantly faster than lists of pairs and functional maps.
 
=== Optimj ===
[[http://www.ateji.com/optimj.html|Optimj]] is an extension of the [[Java (programming language)|Java]]. It includes true associative arrays. For example, an associative array mapping strings to strings might be specified as follows:
 
<source lang="java">
String[String] phoneBook = {
"Sally Smart" -> "555-9999",
"John Doe" -> "555-1212",
"J. Random Hacker" -> "555-1337"
}
</source>
 
<code>phoneBook["John Doe"]</code> access a value by a key.
 
In fact, associative arrays mimics as soon as possible java arrays.
 
=== Perl ===