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

Content deleted Content added
Mathematica and Wolfram Language: copy editing and linking
MUMPS: copy editing
Line 1,054:
Values[phonebook]
 
=== [[MUMPS]] ===
In [[MUMPS]] every array is an associative array. The built-in, language-level, direct support for associative arrays
applies to private, process-specific arrays stored in memory called "locals" as well as to the permanent, shared, global arrays stored on disk which are available concurrently byto multiple jobs. The name for globals is preceded by the circumflex "^" to distinguish itthem from local variable namesvariables.
 
SET ^phonebook("Sally Smart")="555-9999" ;; storing permanent data
SET phonebook("John Doe")="555-1212" ;; storing temporary data
SET phonebook("J. Random Hacker")="553-1337" ;; storing temporary data
MERGE ^phonebook=phonebook ;; copying temporary data into permanent data
 
To accessAccessing the value of an element, simply requires using the name with the subscript:
 
WRITE "Phone Number :",^phonebook("Sally Smart"),!