Michael Heerdegen writes: > BTW, with the suggested approach, you can use a counter to specify a > break condition, like here, were I want to calculate the stream of > natural numbers up to a place where two subsequent elements have a > difference that is not less than 2 (which never happens), but where I > say I want to have at most 25 elements: > > #+begin_src emacs-lisp > (seq-into-sequence > (car > (stream-divide > (let (the-naturals) (setq the-naturals (stream-cons 1 (seq-map #'1+ the-naturals)))) > (let ((counter 0)) > (lambda (this next) > (and (< (cl-incf counter) 25) > (< (- next this) 2))))))) > ==> (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25) > #+end_src That's really neat! Cheers, Nico