Associative array/Creation: Difference between revisions

Content added Content deleted
Line 1,288: Line 1,288:
Scheme has association lists (alists), which are inefficient, ordered maps with arbitrary keys and values.
Scheme has association lists (alists), which are inefficient, ordered maps with arbitrary keys and values.
<lang scheme>(define my-dict '((a b) (1 hello) ("c" (a b c)))
<lang scheme>(define my-dict '((a b) (1 hello) ("c" (a b c)))
(assoc 'a my-dict) ; evaluates to 'b</lang>
(assoc 'a my-dict) ; evaluates to '(a b)</lang>