diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
commit | a82b6c772089aa46e30c6c89ef48f514294df3cb (patch) | |
tree | e25d9b6fd1fefe8b6ac293a5c0b53293872a8f54 /doc/ref/general/srfi-41.texi | |
parent | Add basic documentation for lens. (diff) | |
parent | Even more documentation. (diff) | |
download | calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.gz calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.xz |
Merge branch 'next' into datarewrite-structures
Diffstat (limited to '')
-rw-r--r-- | doc/ref/general/srfi-41.texi (renamed from doc/ref/guile/srfi-41.texi) | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/ref/guile/srfi-41.texi b/doc/ref/general/srfi-41.texi index 8c65b6eb..d8020ecc 100644 --- a/doc/ref/guile/srfi-41.texi +++ b/doc/ref/general/srfi-41.texi @@ -39,7 +39,7 @@ was found. @end defun -@defun stream-remave pred stream +@defun stream-remove pred stream Stream-filter, but with predicate negated. @end defun @@ -73,6 +73,26 @@ times. stream cons, but eval arguments beforehand. @end defun +@defun stream-split-by pred strm +Chunks the content of @var{strm} into lists, breaking on @var{pred}. +If the end of the stream is reached, the remaining objects +are put into a final chunk. + +Can for example be used to split a stream of characters into a stream +of words. + +@lisp +(stream-split-by (lambda (c) (char=? c #\space)) + (-> "This is a short test" + string->list list->stream)) +⇒ #<stream (#\T #\h #\i #\s #\space) + (#\i #\s #\space) + (#\a #\space) + (#\s #\h #\o #\r #\t #\space) + (#\t #\e #\s #\t)> +@end lisp +@end defun + @defun stream-timeslice-limit stream timeslice Wrap a stream in time limits. Each element has at most @var{timeslice} seconds to produce a value, otherwise the stream ends. Useful for finding the |