[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-34-gd86a0
From: |
Mark H Weaver |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-34-gd86a063 |
Date: |
Thu, 05 Jun 2014 01:07:09 +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=d86a0631585ba887cd8635001f3a2c8d000c6517
The branch, stable-2.0 has been updated
via d86a0631585ba887cd8635001f3a2c8d000c6517 (commit)
via fc8a90043bb8dc876cf638d9959348883c748fe3 (commit)
via 4afca1a0662323ed8760c75d84c3aadc64b72908 (commit)
via 1ea8954814d124b995f2296bc6aec92adb566bc1 (commit)
from 2da97f1c7c0748509180308d9e6a817bc49172e7 (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 d86a0631585ba887cd8635001f3a2c8d000c6517
Author: Dmitry Bogatov <address@hidden>
Date: Wed Jun 4 20:49:28 2014 -0400
Fix typo in `transform-string' doc.
* doc/ref/texinfo.texi: Fix single typo.
Signed-off-by: Dmitry Bogatov <address@hidden>
commit fc8a90043bb8dc876cf638d9959348883c748fe3
Author: Mark H Weaver <address@hidden>
Date: Wed Jun 4 20:42:21 2014 -0400
Optimize scm_ilength and 'length+'.
* libguile/list.c (scm_ilength): Test for SCM_NULL_OR_NIL_P only after
testing scm_is_pair. Conform to GNU coding standards.
* libguile/srfi-1.c (scm_srfi1_length_plus): Ditto.
commit 4afca1a0662323ed8760c75d84c3aadc64b72908
Author: Mark H Weaver <address@hidden>
Date: Wed Jun 4 20:40:23 2014 -0400
test-guild-compile: Increase sleep time before sending SIGINT.
* test-suite/standalone/test-guild-compile: Increase sleep time
before sending SIGINT, for slow machines.
commit 1ea8954814d124b995f2296bc6aec92adb566bc1
Author: Mark H Weaver <address@hidden>
Date: Wed Jun 4 19:30:16 2014 -0400
Avoid quadratic expansion time in 'and' and 'or' macros.
Fixes <http://bugs.gnu.org/17147>.
Reported by David Kastrup <address@hidden>.
* module/ice-9/boot-9.scm (and, or): Use dotted tail instead of ellipsis
in patterns.
-----------------------------------------------------------------------
Summary of changes:
doc/ref/texinfo.texi | 2 +-
libguile/list.c | 31 +++++++++++++++--------------
libguile/srfi-1.c | 22 ++++++++++++++------
module/ice-9/boot-9.scm | 10 ++++----
test-suite/standalone/test-guild-compile | 2 +-
5 files changed, 38 insertions(+), 29 deletions(-)
diff --git a/doc/ref/texinfo.texi b/doc/ref/texinfo.texi
index ec06863..5006fd4 100644
--- a/doc/ref/texinfo.texi
+++ b/doc/ref/texinfo.texi
@@ -287,7 +287,7 @@ as an argument, and the returned value is sent to the
output string via
@samp{display}. If @var{replace} is anything else, it is sent through
the output string via @samp{display}.
-Note that te replacement for the matched characters does not need to be
+Note that the replacement for the matched characters does not need to be
a single character. That is what differentiates this function from
@samp{string-map}, and what makes it useful for applications such as
converting @samp{#\&} to @samp{"&"} in web page text. Some other
diff --git a/libguile/list.c b/libguile/list.c
index 01f23c0..669f566 100644
--- a/libguile/list.c
+++ b/libguile/list.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1995,1996,1997,2000,2001,2003,2004,2008,2009,2010,2011
- * Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997, 2000, 2001, 2003, 2004, 2008-2011,
+ * 2014 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -179,24 +179,25 @@ SCM_DEFINE (scm_list_p, "list?", 1, 0, 0,
long" lists (i.e. lists with cycles in their cdrs), and returns -1
if it does find one. */
long
-scm_ilength(SCM sx)
+scm_ilength (SCM sx)
{
long i = 0;
SCM tortoise = sx;
SCM hare = sx;
- do {
- if (SCM_NULL_OR_NIL_P(hare)) return i;
- if (!scm_is_pair (hare)) return -1;
- hare = SCM_CDR(hare);
- i++;
- if (SCM_NULL_OR_NIL_P(hare)) return i;
- if (!scm_is_pair (hare)) return -1;
- hare = SCM_CDR(hare);
- i++;
- /* For every two steps the hare takes, the tortoise takes one. */
- tortoise = SCM_CDR(tortoise);
- }
+ do
+ {
+ if (!scm_is_pair (hare))
+ return SCM_NULL_OR_NIL_P (hare) ? i : -1;
+ hare = SCM_CDR (hare);
+ i++;
+ if (!scm_is_pair (hare))
+ return SCM_NULL_OR_NIL_P (hare) ? i : -1;
+ hare = SCM_CDR (hare);
+ i++;
+ /* For every two steps the hare takes, the tortoise takes one. */
+ tortoise = SCM_CDR (tortoise);
+ }
while (!scm_is_eq (hare, tortoise));
/* If the tortoise ever catches the hare, then the list must contain
diff --git a/libguile/srfi-1.c b/libguile/srfi-1.c
index fcbf806..c0b7035 100644
--- a/libguile/srfi-1.c
+++ b/libguile/srfi-1.c
@@ -620,20 +620,28 @@ SCM_DEFINE (scm_srfi1_length_plus, "length+", 1, 0, 0,
do
{
- if (SCM_NULL_OR_NIL_P (hare))
- return scm_from_size_t (i);
if (!scm_is_pair (hare))
- scm_wrong_type_arg_msg (FUNC_NAME, 1, lst, "proper or circular list");
+ {
+ if (SCM_NULL_OR_NIL_P (hare))
+ return scm_from_size_t (i);
+ else
+ scm_wrong_type_arg_msg (FUNC_NAME, 1, lst,
+ "proper or circular list");
+ }
hare = SCM_CDR (hare);
i++;
- if (SCM_NULL_OR_NIL_P (hare))
- return scm_from_size_t (i);
if (!scm_is_pair (hare))
- scm_wrong_type_arg_msg (FUNC_NAME, 1, lst, "proper or circular list");
+ {
+ if (SCM_NULL_OR_NIL_P (hare))
+ return scm_from_size_t (i);
+ else
+ scm_wrong_type_arg_msg (FUNC_NAME, 1, lst,
+ "proper or circular list");
+ }
hare = SCM_CDR (hare);
i++;
/* For every two steps the hare takes, the tortoise takes one. */
- tortoise = SCM_CDR(tortoise);
+ tortoise = SCM_CDR (tortoise);
}
while (!scm_is_eq (hare, tortoise));
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 42d7d78..c6d4be1 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -1,8 +1,6 @@
;;; -*- mode: scheme; coding: utf-8; -*-
-;;;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
-;;;; Free Software Foundation, Inc.
+;;;; Copyright (C) 1995-2014 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -409,13 +407,15 @@ If there is no handler at all, Guile prints an error and
then exits."
(syntax-rules ()
((_) #t)
((_ x) x)
- ((_ x y ...) (if x (and y ...) #f))))
+ ;; Avoid ellipsis, which would lead to quadratic expansion time.
+ ((_ x . y) (if x (and . y) #f))))
(define-syntax or
(syntax-rules ()
((_) #f)
((_ x) x)
- ((_ x y ...) (let ((t x)) (if t t (or y ...))))))
+ ;; Avoid ellipsis, which would lead to quadratic expansion time.
+ ((_ x . y) (let ((t x)) (if t t (or . y))))))
(include-from-path "ice-9/quasisyntax")
diff --git a/test-suite/standalone/test-guild-compile
b/test-suite/standalone/test-guild-compile
index 05d45ce..525ecc6 100755
--- a/test-suite/standalone/test-guild-compile
+++ b/test-suite/standalone/test-guild-compile
@@ -18,7 +18,7 @@ guild compile -o "$target" "$source" &
pid="$!"
# Send SIGINT.
-sleep 1 && kill -INT "$pid"
+sleep 2 && kill -INT "$pid"
# Wait for 'guild compile' to terminate.
sleep 2
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-34-gd86a063,
Mark H Weaver <=