]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/stream.el: Define macros early
authorNicolas Petton <nicolas@petton.fr>
Fri, 14 Aug 2015 13:58:07 +0000 (15:58 +0200)
committerNicolas Petton <nicolas@petton.fr>
Fri, 14 Aug 2015 13:58:07 +0000 (15:58 +0200)
lisp/emacs-lisp/stream.el

index 012957200b61a914063a495cac4ac903f476a08a..f1d2631eaee396113d8deb85d903526878ef8f37 100644 (file)
 (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)))
 \f
 
 ;;; Convenient functions for creating streams
@@ -129,19 +142,6 @@ range is infinite."
      (stream-range (+ start step) end step))))
 \f
 
-(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)