Stop show with sound -- Keyboard shortcut: 'x'  Next slide in show -- Keyboard shortcut: 'n'  2 minutes, 3 secondsExpressions, Types, and Functions - slide 22 : 46

Association lists

An association list is a list of cons pairs

Association lists are used in the same way as associative arrays

Expression

Value

(define computer-prefs 
 '((peter . windows) (lars . mac)
   (paw . linux) (kurt . unix)))
(assq 'lars computer-prefs)
(lars . mac)
(assq 'kurt computer-prefs)
(kurt . unix)
(define computer-prefs-1
 (cons (cons 'lene 'windows) 
  computer-prefs))
computer-prefs-1
((lene . windows)
 (peter . windows) 
 (lars . mac)
 (paw . linux)
 (kurt . unix))
Go to exercise
Creation of association lists
Go to exercise
Association list and property lists