Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 4th, 2013  |  syntax: Lisp  |  size: 0.12 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (defn pos [ls elem]
  2.   (cond (empty? ls) -1
  3.         (= (first ls) elem) 0
  4.         :else (+ 1 (pos (rest ls) elem))))
clone this paste RAW Paste Data