guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-26-gda0c22


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-26-gda0c22b
Date: Mon, 21 Feb 2011 23:37:43 +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=da0c22b5d307752770eec9ad218f018d55d403d9

The branch, stable-2.0 has been updated
       via  da0c22b5d307752770eec9ad218f018d55d403d9 (commit)
       via  1e1808c920fb0defe75850af26fae199e1090384 (commit)
       via  2a39def1a8f9dc814083f51acc3dd8a5819afeff (commit)
       via  8bc5b79df78aeefa8fc15b040deb43fb14846d26 (commit)
       via  9d798af739a6b3a1fa66c19bc5864bdd57e8d5b5 (commit)
       via  630b6588b7b26bf96874b235ff43ee4c3974cce3 (commit)
      from  0e8a11c49a0ccc8d76807133e9abf82f8e14d1ec (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 da0c22b5d307752770eec9ad218f018d55d403d9
Author: Ludovic Courtès <address@hidden>
Date:   Tue Feb 22 00:32:00 2011 +0100

    Fix a bug in `vhash-delete'.
    
    * module/ice-9/vlist.scm (vhash-delete): Honor HASH.
    * test-suite/tests/vlist.test ("vhash")["vhash-delete honors HASH"]: New 
test.

commit 1e1808c920fb0defe75850af26fae199e1090384
Author: Ludovic Courtès <address@hidden>
Date:   Tue Feb 22 00:31:00 2011 +0100

    Use `vhash-delq' in `(language tree-il analyze)'.
    
    * module/language/tree-il/analyze.scm (unbound-variable-analysis): Use
      `vhash-delq' instead of `vhash-delete'.

commit 2a39def1a8f9dc814083f51acc3dd8a5819afeff
Author: Ludovic Courtès <address@hidden>
Date:   Tue Feb 22 00:08:39 2011 +0100

    Optimize `vhash-delete'.
    
    * module/ice-9/vlist.scm (vhash-delete): Check whether KEY is in VHASH
      and return VHASH if it's not.

commit 8bc5b79df78aeefa8fc15b040deb43fb14846d26
Author: Ludovic Courtès <address@hidden>
Date:   Tue Feb 22 00:07:48 2011 +0100

    Add omitted exports from `(ice-9 vlist)'.
    
    * module/ice-9/vlist.scm: Export `vhash-delq' and `vhash-delv'.

commit 9d798af739a6b3a1fa66c19bc5864bdd57e8d5b5
Author: Ludovic Courtès <address@hidden>
Date:   Tue Feb 22 00:05:05 2011 +0100

    Compile `(rnrs)' after all other RNRS modules, potentially.
    
    * module/Makefile.am (RNRS_SOURCES): Move `rnrs.scm' last.

commit 630b6588b7b26bf96874b235ff43ee4c3974cce3
Author: Ludovic Courtès <address@hidden>
Date:   Tue Feb 22 00:32:13 2011 +0100

    Make `(rnrs base)' independent of other rnrs modules.
    
    * module/rnrs/base.scm (define-proxy): New macro.
      (raise, condition, make-error, make-assertion-violation,
      make-who-condition, make-message-condition, make-irritants-condition):
      Use it.

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

Summary of changes:
 module/Makefile.am                  |    4 ++--
 module/ice-9/vlist.scm              |   23 +++++++++++++----------
 module/language/tree-il/analyze.scm |    7 +++----
 module/rnrs/base.scm                |   35 ++++++++++++++++++++++-------------
 test-suite/tests/vlist.test         |   14 +++++++++++++-
 5 files changed, 53 insertions(+), 30 deletions(-)

diff --git a/module/Makefile.am b/module/Makefile.am
index c0f6886..16ce6d2 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -269,7 +269,6 @@ SRFI_SOURCES = \
   srfi/srfi-98.scm
 
 RNRS_SOURCES =                                 \
-  rnrs.scm                                     \
   rnrs/base.scm                                        \
   rnrs/conditions.scm                          \
   rnrs/control.scm                             \
@@ -294,7 +293,8 @@ RNRS_SOURCES =                                      \
   rnrs/io/ports.scm                            \
   rnrs/records/inspection.scm                  \
   rnrs/records/procedural.scm                  \
-  rnrs/records/syntactic.scm
+  rnrs/records/syntactic.scm                   \
+  rnrs.scm
 
 EXTRA_DIST += scripts/ChangeLog-2008
 EXTRA_DIST += scripts/README
diff --git a/module/ice-9/vlist.scm b/module/ice-9/vlist.scm
index 5ea0936..34c7c00 100644
--- a/module/ice-9/vlist.scm
+++ b/module/ice-9/vlist.scm
@@ -1,6 +1,6 @@
 ;;; -*- mode: scheme; coding: utf-8; -*-
 ;;;
-;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;;; Copyright (C) 2009, 2010, 2011 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
@@ -32,7 +32,8 @@
 
             vhash? vhash-cons vhash-consq vhash-consv
             vhash-assoc vhash-assq vhash-assv
-            vhash-delete vhash-fold
+            vhash-delete vhash-delq vhash-delv
+            vhash-fold
             vhash-fold* vhash-foldq* vhash-foldv*
             alist->vhash))
 
@@ -529,14 +530,16 @@ value of @var{result} for the first call to @var{proc}."
 (define* (vhash-delete key vhash #:optional (equal? equal?) (hash hash))
   "Remove all associations from @var{vhash} with @var{key}, comparing keys
 with @var{equal?}."
-  (vlist-fold (lambda (k+v result)
-                (let ((k (car k+v))
-                      (v (cdr k+v)))
-                  (if (equal? k key)
-                      result
-                      (vhash-cons k v result))))
-              vlist-null
-              vhash))
+  (if (vhash-assoc key vhash equal? hash)
+      (vlist-fold (lambda (k+v result)
+                    (let ((k (car k+v))
+                          (v (cdr k+v)))
+                      (if (equal? k key)
+                          result
+                          (vhash-cons k v result hash))))
+                  vlist-null
+                  vhash)
+      vhash))
 
 (define vhash-delq (cut vhash-delete <> <> eq? hashq))
 (define vhash-delv (cut vhash-delete <> <> eqv? hashv))
diff --git a/module/language/tree-il/analyze.scm 
b/module/language/tree-il/analyze.scm
index 745ce39..60a5bcd 100644
--- a/module/language/tree-il/analyze.scm
+++ b/module/language/tree-il/analyze.scm
@@ -1,6 +1,6 @@
 ;;; TREE-IL -> GLIL compiler
 
-;; Copyright (C) 2001,2008,2009,2010 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2008, 2009, 2010, 2011 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
@@ -926,7 +926,7 @@ accurate information is missing from a given `tree-il' 
element."
                 (make-toplevel-info (vhash-consq name src refs)
                                     defs))))
          ((<toplevel-define> name)
-          (make-toplevel-info (vhash-delete name refs eq?)
+          (make-toplevel-info (vhash-delq name refs)
                               (vhash-consq name #t defs)))
 
          ((<application> proc args)
@@ -935,8 +935,7 @@ accurate information is missing from a given `tree-il' 
element."
           (let ((name (goops-toplevel-definition proc args
                                                  env)))
             (if (symbol? name)
-                (make-toplevel-info (vhash-delete name refs
-                                                  eq?)
+                (make-toplevel-info (vhash-delq name refs)
                                     (vhash-consq name #t defs))
                 (make-toplevel-info refs defs))))
          (else
diff --git a/module/rnrs/base.scm b/module/rnrs/base.scm
index 4c9c51b..2f5a218 100644
--- a/module/rnrs/base.scm
+++ b/module/rnrs/base.scm
@@ -123,24 +123,33 @@
  (define (vector-map proc . vecs)
    (list->vector (apply map (cons proc (map vector->list vecs)))))
 
- (define-syntax raise
-   ;; Resolve the real `raise' lazily to avoid a circular dependency
-   ;; between `(rnrs base)' and `(rnrs exceptions)'.
-   (syntax-rules ()
-     ((_ c)
-      ((@ (rnrs exceptions) raise) c))))
-
- (define condition
+ (define-syntax define-proxy
+   (syntax-rules (@)
+     ;; Define BINDING to point to (@ MODULE ORIGINAL).  This hack is to
+     ;; make sure MODULE is loaded lazily, at run-time, when BINDING is
+     ;; encountered, rather than being loaded while compiling and
+     ;; loading (rnrs base).
+     ;; This avoids circular dependencies among modules and makes
+     ;; (rnrs base) more lightweight.
+     ((_ binding (@ module original))
+      (define-syntax binding
+        (identifier-syntax
+         (module-ref (resolve-interface 'module) 'original))))))
+
+ (define-proxy raise
+   (@ (rnrs exceptions) raise))
+
+ (define-proxy condition
    (@ (rnrs conditions) condition))
- (define make-error
+ (define-proxy make-error
    (@ (rnrs conditions) make-error))
- (define make-assertion-violation
+ (define-proxy make-assertion-violation
    (@ (rnrs conditions) make-assertion-violation))
- (define make-who-condition
+ (define-proxy make-who-condition
    (@ (rnrs conditions) make-who-condition))
- (define make-message-condition
+ (define-proxy make-message-condition
    (@ (rnrs conditions) make-message-condition))
- (define make-irritants-condition
+ (define-proxy make-irritants-condition
    (@ (rnrs conditions) make-irritants-condition))
 
  (define (error who message . irritants)
diff --git a/test-suite/tests/vlist.test b/test-suite/tests/vlist.test
index f3e0989..b590bbd 100644
--- a/test-suite/tests/vlist.test
+++ b/test-suite/tests/vlist.test
@@ -2,7 +2,7 @@
 ;;;;
 ;;;; Ludovic Courtès <address@hidden>
 ;;;;
-;;;;   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2009, 2010, 2011 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
@@ -282,6 +282,18 @@
                    #t
                    keys)))))
 
+  (pass-if "vhash-delete honors HASH"
+    ;; In 2.0.0, `vhash-delete' would construct a new vhash without
+    ;; using the supplied hash procedure, which could lead to
+    ;; inconsistencies.
+    (let* ((s  "hello")
+           (vh (fold vhash-consq
+                     (vhash-consq s "world" vlist-null)
+                     (iota 300)
+                     (iota 300))))
+      (and (vhash-assq s vh)
+           (pair? (vhash-assq s (vhash-delete 123 vh eq? hashq))))))
+
   (pass-if "vhash-fold"
     (let* ((keys   '(a b c d e f g d h i))
            (values '(1 2 3 4 5 6 7 0 8 9))


hooks/post-receive
-- 
GNU Guile



reply via email to

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