* module/ice-9/match.upstream.scm (match-gen-ellipsis): Instead of just
binding the identifier when matching (x ...), go through match-one so
that if the id is already bound, we unify instead.
* test-suite/tests/match.test ("unify in list patterns"): Add test.
* test-suite/tests/match.test.upstream: Add additional tests from
upstream.
See commit 05c546e38 in Chibi Scheme. Thanks to Alex Shinn for help
here!
* module/ice-9/match.upstream.scm (match-next): Use throw, so that CPS
can see that there's no fallthrough.
* module/ice-9/match.scm: Add a note about what to do in 3.1 to remove
the old "error" definition.
Fixes <https://bugs.gnu.org/22925> and other bugs.
* module/ice-9/match.upstream.scm: Apply selected fixes from the
upstream match.scm in Chibi-Scheme.
* test-suite/tests/match.test.upstream: Add more tests from upstream.
* module/ice-9/match.upstream.scm: Change several occurrences
of 'ellipse' and 'ellipses' to 'ellipsis', to more closely match
match.scm from Chibi-Scheme.
* module/ice-9/match.upstream.scm (match-next): Inline a call to
"error", so the new CSE pass will see this case as a bailout.
* module/srfi/srfi-9.scm (throw-bad-struct): Reimplement as a syntax
rule, so that the CSE pass sees the "throw" call.
* module/language/tree-il/effects.scm (make-effects-analyzer): Allow
module-ref calls to be treated as bailouts, if the procedure has the
"definite-bailout?" property. Perhaps this should be renamed.
* module/ice-9/match.upstream.scm (match-error):
* module/srfi/srfi-9.scm (throw-bad-struct): Give these procedures the
definite-bailout? property.
* module/ice-9/match.upstream.scm (match-next): Call out to an external
procedure on error, and use a begin instead of double-parens. This
results in less generated code.
* 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.
* module/ice-9/match.scm (slot-ref, slot-set!, is-a?): New macros.
* module/ice-9/match.upstream.scm: Update from Chibi-Scheme.
* test-suite/Makefile.am (SCM_TESTS): Add `tests/match.test.upstream'.
* test-suite/tests/match.test (rtd-2-slots, rtd-3-slots): New record
types.
("matches")["records"]: New test prefix.
("doesn't match")["records"]: New test prefix.
Include `match.test.upstream'.
* test-suite/vm/t-match.scm (matches?): Fix `$' example.
Patch accepted upstream:
<http://lists.gnu.org/archive/html/guile-devel/2010-09/threads.html#00114>.
* module/ice-9/match.upstream.scm (match-two): Add support for `..1'.
* test-suite/tests/match.test ("matches")["list ..1", "list ..1, with
predicate"]: New tests.
("doesn't match")["list ..1", "list ..1, with predicate"]: New tests.