Skip to content

Instantly share code, notes, and snippets.

Created June 24, 2011 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1045758 to your computer and use it in GitHub Desktop.
Save anonymous/1045758 to your computer and use it in GitHub Desktop.
iterate each item in a list once
(def examplelist '(1 2 3 4 5))
(def newlist ())
(if (<= 0 (count examplelist))
;figure out a way to use let instead of an inline def here
(do (conj newlist (+ 1 (peek examplelist))) (def examplelist (pop examplelist))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment