Guest User

Untitled

a guest
Jan 5th, 2012
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn drop-every-nth [seq n]
  2.   (loop [se seq
  3.          nth 1
  4.          curr '()]
  5.     (if (empty? se)
  6.       (reverse curr)
  7.       (if (zero? (mod nth n))
  8.           (recur (rest se) (inc nth) curr)
  9.           (recur (rest se) (inc nth) (conj curr (first se)))))))
Advertisement
Add Comment
Please, Sign In to add comment