   (let [new-pair (kons item nil)]
     (if (empty-queue? queue)
       (do (set-front-ptr! queue new-pair)
-          (set-rear-ptr! queue new-pair)
-          queue)
+          (set-rear-ptr! queue new-pair))
       (do (set-cdr! (rear-ptr queue) new-pair)
-          (set-rear-ptr! queue new-pair)
-          queue))))
+          (set-rear-ptr! queue new-pair)))
+    queue))
 
 (defn delete-queue! [queue]
   (if (empty-queue? queue)

    dispatch))

;; Exercise 3.23
;; TODO

;;; 3.3.3  Representing Tables


(defn lookup'' [keys table]
  (loop [keys keys
         table table]
    (if-let [subtable (assok (first keys) (cdr table))]
      (if (empty? (rest keys))
        (cdr subtable)
        (recur (rest keys) subtable))
      false)))

;; FIXME
(defn insert!'' [keys value table]
  (loop [keys keys
         table table]
    (if-let [subtable (assok (first keys) (cdr table))]
      (if (empty? (rest keys))
        (set-cdr! subtable value)
        (recur (rest keys) subtable))
      (set-cdr! table
                (let [rkeys (reverse keys)]
                  (kons (reduce #(scheme-like-list %2 %1)
                                (kons (first rkeys) value)
                                (rest rkeys))
                        (cdr table))))))
  :ok)

;;; 3.3.4  A Simulator for Digital Circuits
