guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, srfi-41, updated. v2.0.7-214-g821becf


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, srfi-41, updated. v2.0.7-214-g821becf
Date: Thu, 21 Mar 2013 00:34:55 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=821becfc39399d35d92643ed77171374aa781318

The branch, srfi-41 has been updated
       via  821becfc39399d35d92643ed77171374aa781318 (commit)
      from  a540215119c43f3ad5c3491f249fc6dc1869a921 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 821becfc39399d35d92643ed77171374aa781318
Author: Mark H Weaver <address@hidden>
Date:   Wed Mar 20 20:29:04 2013 -0400

    Make 'stream-fold-aux' an inlined procedure.
    
    Suggested by Ian Price <address@hidden>.
    
    * module/srfi/srfi-41.scm (stream-fold-aux): Use 'define-inlinable'
      and change the optional 'limit' argument into a required argument.
      Move it above all uses.
      (stream-fold): Pass required 'limit' argument to 'stream-fold-aux'.

-----------------------------------------------------------------------

Summary of changes:
 module/srfi/srfi-41.scm |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/module/srfi/srfi-41.scm b/module/srfi/srfi-41.scm
index 09e4547..16596ce 100644
--- a/module/srfi/srfi-41.scm
+++ b/module/srfi/srfi-41.scm
@@ -208,6 +208,15 @@
     ((_) stream-null)
     ((_ x y ...) (stream-cons x (stream y ...)))))
 
+;; Common helper for the various eager-folding functions, such as
+;; stream-fold, stream-drop, stream->list, stream-length, etc.
+(define-inlinable (stream-fold-aux proc base strm limit)
+  (do ((val base (and proc (proc val (stream-car strm))))
+       (strm strm (stream-cdr strm))
+       (limit limit (and limit (1- limit))))
+      ((or (and limit (zero? limit)) (stream-null? strm))
+       (values val strm limit))))
+
 (define stream->list
   (case-lambda
    ((strm) (stream->list #f strm))
@@ -291,16 +300,7 @@
 (define (stream-fold proc base strm)
   (must procedure? proc 'stream-fold "non-procedural argument")
   (must stream? strm 'stream-fold "non-stream argument")
-  (first-value (stream-fold-aux proc base strm)))
-
-;; Common helper for the various eager-folding functions, such as
-;; stream-fold, stream-drop, stream->list, stream-length, etc.
-(define* (stream-fold-aux proc base strm #:optional limit)
-  (do ((val base (and proc (proc val (stream-car strm))))
-       (strm strm (stream-cdr strm))
-       (limit limit (and limit (1- limit))))
-      ((or (and limit (zero? limit)) (stream-null? strm))
-       (values val strm limit))))
+  (first-value (stream-fold-aux proc base strm #f)))
 
 (define stream-for-each
   (case-lambda


hooks/post-receive
-- 
GNU Guile



reply via email to

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