previous | index | next

Mapping Lists

map allows procedures of more than one argument:
          (map + '(1 2 3) '(4 5 6)) ⇒ (5 7 9)

          (map list '(this when words of)
                    '(sentence you together the)    
                    '(should zip using map)         
                    '(make all your Scheme)         
                    '(sense the version procedure)) 
          ⇒ ((this sentence should make sense)     
             (when you zip all the)                
             (words together using your version)   
             (of the map Scheme procedure))
Exercise 7.14: Write map yourself (the single argument version).

previous | index | next