Skip to content

Commit

Permalink
stream: add some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
pflanze committed Sep 4, 2020
1 parent dd6265e commit bc8cd85
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stream.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,8 @@
chop/map
stream-chop/map
(typed-lambda ([natural? n] s [procedure? f] #!optional (tail '()))
"Split `s` into pieces of length `n` or (in the case
of the last piece) potentially less. Also see `sectionize`."
(let buildup ((s s)
(l '())
(m n))
Expand Down Expand Up @@ -1389,6 +1391,9 @@

(define-strict-and-lazy sectionize stream-sectionize
(typed-lambda ([fixnum-natural? section-len] l)
"Return a list of vectors representing pieces of `l`
of exactly length `section-len` (it is an error to give inputs that
don't evenly split). Also see `chop`."
(let rec ((l l))
(DELAY
(let ((v (make-vector section-len)))
Expand Down

0 comments on commit bc8cd85

Please sign in to comment.