[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.9-71-g8d5d04
From: |
Mark H Weaver |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.9-71-g8d5d042 |
Date: |
Thu, 15 Aug 2013 08:08:42 +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=8d5d0425ce10dcf035fbf717852938291261bd7e
The branch, stable-2.0 has been updated
via 8d5d0425ce10dcf035fbf717852938291261bd7e (commit)
from b57162c3d21fdc9e48572d7a9d4009c37f2c647a (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 8d5d0425ce10dcf035fbf717852938291261bd7e
Author: Mark H Weaver <address@hidden>
Date: Thu Aug 15 03:59:15 2013 -0400
Improve run-time error reporting in (ice-9 match).
* module/Makefile.am: match.go depends on match.upstream.scm.
* module/ice-9/match.scm (error): Accept any number of arguments.
* module/ice-9/match.upstream.scm (match-next): Call 'error' in non-tail
context, and include the value that failed to match in the call.
-----------------------------------------------------------------------
Summary of changes:
module/Makefile.am | 1 +
module/ice-9/match.scm | 4 ++--
module/ice-9/match.upstream.scm | 5 ++++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/module/Makefile.am b/module/Makefile.am
index d43be04..e8dcd4a 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -33,6 +33,7 @@ EXTRA_DIST += ice-9/eval.scm
ETAGS_ARGS += ice-9/eval.scm
ice-9/boot-9.go: ice-9/boot-9.scm ice-9/quasisyntax.scm
ice-9/r6rs-libraries.scm
+ice-9/match.go: ice-9/match.scm ice-9/match.upstream.scm
# We can compile these in any order, but it's fastest if we compile
# psyntax and boot-9 first, then the compiler itself, then the rest of
diff --git a/module/ice-9/match.scm b/module/ice-9/match.scm
index 7fd191a..099afb5 100644
--- a/module/ice-9/match.scm
+++ b/module/ice-9/match.scm
@@ -24,9 +24,9 @@
match-let*
match-letrec))
-(define (error _ msg)
+(define (error _ . args)
;; Error procedure for run-time "no matching pattern" errors.
- (throw 'match-error "match" msg))
+ (apply throw 'match-error "match" args))
;; Support for record matching.
diff --git a/module/ice-9/match.upstream.scm b/module/ice-9/match.upstream.scm
index 29f9dbe..4609883 100644
--- a/module/ice-9/match.upstream.scm
+++ b/module/ice-9/match.upstream.scm
@@ -284,7 +284,10 @@
(syntax-rules (=>)
;; no more clauses, the match failed
((match-next v g+s)
- (error 'match "no matching pattern"))
+ ;; Here we wrap error within a double set of parentheses, so that
+ ;; the call to 'error' won't be in tail position. This allows the
+ ;; backtrace to show the source location of the failing match form.
+ ((error 'match "no matching pattern" v)))
;; named failure continuation
((match-next v g+s (pat (=> failure) . body) . rest)
(let ((failure (lambda () (match-next v g+s . rest))))
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.9-71-g8d5d042,
Mark H Weaver <=