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:

    It is not the language of painters but the language of nature which one should listen to.... The feeling for the things themselves, for reality, is more important than the feeling for pictures.
    Vincent Van Gogh (1853–1890)

    ... the outcome of the Clarence Thomas hearings and his subsequent appointment to the Supreme Court shows how misguided, narrow notions of racial solidarity that suppress dissent and critique can lead black folks to support individuals who will not protect their rights.
    bell hooks (b. c. 1955)