Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

Fixed docs, added pre-condition for empty seq
  • Loading branch information...
commit 4ae50f9a7bcda1aa2da9257019f04ab10dff6c1f 2 parents f768ba2 + e70092b
@sritchie sritchie authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/clj/forma/utils.clj
View
3  src/clj/forma/utils.clj
@@ -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))))
Please sign in to comment.
Something went wrong with that request. Please try again.