Skip to content

Commit 173b714

Browse files
committed
nth element for stdlib
1 parent 65163ad commit 173b714

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

strats/stdlib.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(defn nth [list pos]
2+
(if (== pos 0) (head list) (nth (tail list) (- pos 1)))

0 commit comments

Comments
 (0)