Skip to content

Instantly share code, notes, and snippets.

@edlich
Created January 1, 2013 23:18
Show Gist options
  • Save edlich/4430925 to your computer and use it in GitHub Desktop.
Save edlich/4430925 to your computer and use it in GitHub Desktop.
Create a cycle that will not be realized but has the index passed around...
(defn mycycle [mylist index]
(println "Habe " mylist "," index)
(println "Mycycle Element = " (nth mylist index))
(read-line)
(if (>= index (dec (count mylist)))
(mycycle mylist 0)
(mycycle mylist (inc index))))
(mycycle '(1 2 3 4 5 6) 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment