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:

    We have tried so hard to adulterate our hearts, and have so greatly abused the microscope to study the hideous excrescences and shameful warts which cover them and which we take pleasure in magnifying, that it is impossible for us to speak the language of other men.
    Charles Baudelaire (1821–1867)

    Three factors—the belief that child care is female work, the failure of ex-husbands to support their children, and higher male wages at work—have taken the economic rug from under that half of married women who divorce.
    Arlie Hochschild (20th century)