Associative Array - Language Support

Language Support

Associative arrays can be implemented in any programming language as a package and many language systems provide them as part of their standard library. In some languages, they are not only built into the standard system, but have special syntax, often using array-like subscripting.

Built-in syntactic support for associative arrays was introduced by SNOBOL4, under the name "table". MUMPS made multi-dimensional associative arrays, optionally persistent, its key data structure. SETL supported them as one possible implementation of sets and maps. Most modern scripting languages, starting with AWK and including Perl, Tcl, JavaScript, Python, Ruby, and Lua, support associative arrays as a primary container type. In many more languages, they are available as library functions without special syntax.

In Smalltalk, Objective-C, .NET, Python, and REALbasic they are called dictionaries; in Perl and Ruby they are called hashes; in C++, Java, Go, Clojure and Scala they are called maps (see map (C++), unordered_map (C++), and Map); in Common Lisp and Windows PowerShell, they are called hash tables (since both typically use this implementation). In PHP, all arrays can be associative, except that the keys are limited to integers and strings. In JavaScript (see also JSON), all objects behave as associative arrays. In Lua, they are called tables, and are used as the primitive building block for all data structures. In Visual FoxPro, they are called Collections.

Read more about this topic:  Associative Array

Famous quotes containing the words language and/or support:

    Language is filled
    with words for deprivation
    images so familiar
    it is hard to crack language open
    into that other country
    the country of being.
    Susan Griffin (b. 1943)

    Children learn to care by experiencing good care. They come to know the blessings of gentleness, or sympathy, of patience and kindness, of support and backing first through the way in which they themselves are treated.
    James L. Hymes, Jr. (20th century)