   (get-first [s])
   (get-last [s]))
 
+(defprotocol FastEmpty
+  (fast-empty? [s]))
+
 (defn- update-first-list [l afn]
   (cons (afn (first l)) (rest l)))
 
 (defn- update-last-list [l afn]
   (append (butlast l) (afn (last l))))
+
+#+clj
+(defn vec-count [^clojure.lang.PersistentVector v]
+  (.count v))
+
+#+cljs
+(defn vec-count [v]
+  (count v))
 
 (extend-protocol UpdateExtremes
   #+clj clojure.lang.PersistentVector #+cljs cljs.core/PersistentVector

    (last s)
    ))

(defn walk-until [pred on-match-fn structure]
  (if (pred structure)
    (on-match-fn structure)

      (assoc v 0 (afn val))
      ))
  (update-last [v afn]
    (let [c (vec-count v)]
      (case c
        1 (let [[e] v] [(afn e)])
        2 (let [[e1 e2] v] [e1 (afn e2)])
        (conj (pop v) (afn (peek v)))
      )))
  #+clj Object #+cljs default
  (update-first [l val]
    (update-first-list l val))
