Skip to content

Instantly share code, notes, and snippets.

@Diullei
Created July 21, 2014 15:18
Show Gist options
  • Save Diullei/315a2b2c8e513056edd0 to your computer and use it in GitHub Desktop.
Save Diullei/315a2b2c8e513056edd0 to your computer and use it in GitHub Desktop.
(defn my-last [xs]
(if (= (count xs) 1)
(first xs)
(my-last (rest xs))))
@edipofederle
Copy link

(use '[clojure.core.match :only (match)])
(defn my-last [xs](match [%28count xs%29]
[1] %28first xs%29
:else %28my-last %28rest xs%29%29))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment