Permalink
Browse files

Merge pull request #46 from reddmetrics/feature/trim-seq

Fixed docs, added pre-condition for empty seq
  • Loading branch information...
2 parents f768ba2 + e70092b commit 4ae50f9a7bcda1aa2da9257019f04ab10dff6c1f @sritchie sritchie committed Jun 15, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/clj/forma/utils.clj
View
@@ -96,8 +96,9 @@
"Trims a sequence with initial value indexed at x0 to fit within
bottom (inclusive) and top (exclusive). For example:
- (trim-seq 0 2 0 [1 2 3]) => [0 1 2]"
+ (trim-seq 0 2 0 [4 5 6]) => [4 5]"
[bottom top x0 seq]
+ {:pre [(not (empty? seq))]}
(->> seq
(drop (- bottom x0))
(drop-last (- (+ x0 (count seq)) top))))

0 comments on commit 4ae50f9

Please sign in to comment.