emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/stream 18146ee 04/36: * packages/stream/stream.el: Upda


From: Stefan Monnier
Subject: [elpa] externals/stream 18146ee 04/36: * packages/stream/stream.el: Update stream.el to v 1.1.0.
Date: Tue, 1 Dec 2020 17:22:47 -0500 (EST)

branch: externals/stream
commit 18146ee53a1811783736d8d59ef2c529b7902e31
Author: Nicolas Petton <nicolas@petton.fr>
Commit: Nicolas Petton <nicolas@petton.fr>

    * packages/stream/stream.el: Update stream.el to v 1.1.0.
---
 stream.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/stream.el b/stream.el
index e1daec7..375999f 100644
--- a/stream.el
+++ b/stream.el
@@ -4,7 +4,7 @@
 
 ;; Author: Nicolas Petton <nicolas@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]