Task

The goal is to create an associative array (also known as a dictionary, map, or hash).



Related tasks:

 Associative arrays/Iteration
 Hash from two arrays


See also

 Array
 Associative array: Creation, Iteration
 Collections
 Compound data type
 Doubly-linked list: Definition, Element definition, Element insertion, List Traversal, Element Removal
 Linked list
 Queue: Definition, Usage
 Set
 Singly-linked list: Element definition, Element insertion, List Traversal, Element Removal
 Stack


{ 'a' 1 'b' 2 'c' 3.14 'd' 'xyz' } as a_hash
a_hash print
 
hash (4 items)
 a => 1
 b => 2
 c => 3.14
 d => "xyz"
 
a_hash 'c' get         # get key 'c'
6.28 a_hash 'c' set    # set key 'c'
a_hash.'c'             # get key 'c' shorthand
6.28 a_hash:'c'        # set key 'c' shorthand