Skip to content
Browse files

Fixed docs, added pre-condition for empty seq

  • Loading branch information...
1 parent 9632506 commit e70092bd18dd4fcd50dbfd39f2d01442c6fe0936 Robin Kraft committed
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))))

0 comments on commit e70092b

Please sign in to comment.
Something went wrong with that request. Please try again.