emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] stream dffce02 3/4: * lisp/emacs-lisp/stream.el: Define ma


From: Nicolas Petton
Subject: [Emacs-diffs] stream dffce02 3/4: * lisp/emacs-lisp/stream.el: Define macros early
Date: Fri, 14 Aug 2015 20:31:28 +0000

branch: stream
commit dffce02b589b73fcc7889af6a48ebb7499238083
Author: Nicolas Petton <address@hidden>
Commit: Nicolas Petton <address@hidden>

    * lisp/emacs-lisp/stream.el: Define macros early
---
 lisp/emacs-lisp/stream.el |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/lisp/emacs-lisp/stream.el b/lisp/emacs-lisp/stream.el
index 0129572..f1d2631 100644
--- a/lisp/emacs-lisp/stream.el
+++ b/lisp/emacs-lisp/stream.el
@@ -74,6 +74,19 @@
 (defun stream--force (delayed)
   "Force the evaluation of DELAYED."
   (funcall delayed))
+
+(defmacro stream-make (&rest body)
+  "Return a stream built from BODY.
+BODY must return nil or a cons cell, which cdr is itself a
+stream."
+  (declare (debug t))
+  `(list ',stream--identifier (stream--delay ,@body)))
+
+(defmacro stream-cons (first rest)
+  "Return a stream built from the cons of FIRST and REST.
+FIRST and REST are forms and REST must return a stream."
+  (declare (debug t))
+  `(stream-make (cons ,first ,rest)))
 
 
 ;;; Convenient functions for creating streams
@@ -129,19 +142,6 @@ range is infinite."
      (stream-range (+ start step) end step))))
 
 
-(defmacro stream-make (&rest body)
-  "Return a stream built from BODY.
-BODY must return nil or a cons cell, which cdr is itself a
-stream."
-  (declare (debug t))
-  `(list ',stream--identifier (stream--delay ,@body)))
-
-(defmacro stream-cons (first rest)
-  "Return a stream built from the cons of FIRST and REST.
-FIRST and REST are forms and REST must return a stream."
-  (declare (debug t))
-  `(stream-make (cons ,first ,rest)))
-
 (defun stream-p (stream)
   "Return non-nil if STREAM is a stream, nil otherwise."
   (and (consp stream)



reply via email to

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