Check out the Pastebin Gadgets Shop. We have thousands of fun, geeky & affordable gadgets on sale :-)Want more features on Pastebin? Sign Up, it's FREE!


By: a guest on Jan 4th, 2013  |  syntax: Lisp  |  size: 0.12 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
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