branch: master commit 4ceb5a259068bf570fdc9dd3d1cad1b31a51f0e3 Author: Nicolas Petton <nico...@petton.fr> Commit: Nicolas Petton <nico...@petton.fr>
* packages/stream/stream.el: Update stream.el to v 1.1.0. --- packages/stream/stream.el | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/stream/stream.el b/packages/stream/stream.el index e1daec7..375999f 100644 --- a/packages/stream/stream.el +++ b/packages/stream/stream.el @@ -4,7 +4,7 @@ ;; Author: Nicolas Petton <nico...@petton.fr> ;; Keywords: stream, laziness, sequences -;; Version: 1.0.1 +;; Version: 1.1.0 ;; Package-Requires: ((emacs "25")) ;; Package: stream @@ -161,7 +161,8 @@ range is infinite." (defun stream-rest (stream) "Return a stream of all but the first element of STREAM." - (cdr (stream--force (cadr stream)))) + (or (cdr (stream--force (cadr stream))) + (stream-empty))) ;;; cl-generic support for streams @@ -224,7 +225,8 @@ This function will eagerly consume the entire stream." (cl-defmethod seq-take ((stream stream) n) "Return a stream of the first N elements of STREAM." - (if (zerop n) + (if (or (zerop n) + (stream-empty-p stream)) (stream-empty) (stream-cons (stream-first stream)