port case fns from clojure.core