; Problem: Write swap-first-two, which swaps the first two
; elements of a list.
(define lst (list 1 2 3 4 5 6 7))
; What do I need to know how to do?
;   (1) Get the first element of a list
(define first (car lst))
;   (2) Get the second element of a list
(define second (car (cdr lst)))
;   (3) Get all but the first two of a list
(define rest (cdr (cdr lst)))
;   (4) Carefully place everything back together
; What do I know how to do?
;   (a) car
;   (b) cdr
;   (c) cons
;   (d) list
;   (e) null
; Problem: We want to carefully place both second
;   and first at the beginning of rest.
; Ah Hah!  First we add first to rest, then we add
;   second to rest.
(define result
   (cons second (cons first rest)))

(define swap-first-two
  (lambda (lst)
    (cons (car (cdr lst)) 
          (cons (car lst) 
                (cdr (cdr lst))))))
