guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-12-100-gf


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-12-100-gf2ee634
Date: Mon, 27 Sep 2010 21:52:20 +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=f2ee6341baa31d75f9734a93545eb2608dd5653c

The branch, master has been updated
       via  f2ee6341baa31d75f9734a93545eb2608dd5653c (commit)
      from  1ffed5aa95d66123a552fa3513373e78a1679287 (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 f2ee6341baa31d75f9734a93545eb2608dd5653c
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 27 23:52:10 2010 +0200

    Fix pattern variable extraction in `match' with `..1'.
    
    * module/ice-9/match.upstream.scm (match-extract-vars): Support `..1'.

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

Summary of changes:
 module/ice-9/match.upstream.scm |    3 ++-
 test-suite/tests/match.test     |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/module/ice-9/match.upstream.scm b/module/ice-9/match.upstream.scm
index bf3335b..df6b3d9 100644
--- a/module/ice-9/match.upstream.scm
+++ b/module/ice-9/match.upstream.scm
@@ -488,7 +488,7 @@
 ;; (match-extract-vars pattern continuation (ids ...) (new-vars ...))
 
 (define-syntax match-extract-vars
-  (syntax-rules (_ ___ *** ? $ = quote quasiquote and or not get! set!)
+  (syntax-rules (_ ___ ..1 *** ? $ = quote quasiquote and or not get! set!)
     ((match-extract-vars (? pred . p) . x)
      (match-extract-vars p . x))
     ((match-extract-vars ($ rec . p) . x)
@@ -518,6 +518,7 @@
      (match-extract-vars (p ...) . x))
     ((match-extract-vars _ (k ...) i v)    (k ... v))
     ((match-extract-vars ___ (k ...) i v)  (k ... v))
+    ((match-extract-vars ..1 (k ...) i v)  (k ... v))
     ((match-extract-vars *** (k ...) i v)  (k ... v))
     ;; This is the main part, the only place where we might add a new
     ;; var if it's an unbound symbol.
diff --git a/test-suite/tests/match.test b/test-suite/tests/match.test
index d1432d8..f2e670c 100644
--- a/test-suite/tests/match.test
+++ b/test-suite/tests/match.test
@@ -77,6 +77,11 @@
       (((and x (? symbol?)) ..1)
        (equal? x '(a b c)))))
 
+  (pass-if "list ..1, nested"
+    (match '((1 2) (3 4))
+      (((x ..1) ..1)
+       (equal? x '((1 2) (3 4))))))
+
   (pass-if "tree"
     (let ((tree '(one (two 2) (three 3 (and 4 (and 5))))))
       (match tree


hooks/post-receive
-- 
GNU Guile



reply via email to

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