mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-06-21 13:26:39 +02:00
fixing combinatorial explosion of code in certain match or patterns
This commit is contained in:
parent
c4bf82842c
commit
cb6d16a8f1
1 changed files with 3 additions and 1 deletions
|
@ -210,6 +210,7 @@
|
||||||
;; performance can be found at
|
;; performance can be found at
|
||||||
;; http://synthcode.com/scheme/match-cond-expand.scm
|
;; http://synthcode.com/scheme/match-cond-expand.scm
|
||||||
;;
|
;;
|
||||||
|
;; 2012/05/23 - fixing combinatorial explosion of code in certain or patterns
|
||||||
;; 2011/09/25 - fixing bug when directly matching an identifier repeated in
|
;; 2011/09/25 - fixing bug when directly matching an identifier repeated in
|
||||||
;; the pattern (thanks to Stefan Israelsson Tampe)
|
;; the pattern (thanks to Stefan Israelsson Tampe)
|
||||||
;; 2011/01/27 - fixing bug when matching tail patterns against improper lists
|
;; 2011/01/27 - fixing bug when matching tail patterns against improper lists
|
||||||
|
@ -479,7 +480,8 @@
|
||||||
(match-one v p . x))
|
(match-one v p . x))
|
||||||
((_ v (p . q) g+s sk fk i)
|
((_ v (p . q) g+s sk fk i)
|
||||||
;; match one and try the remaining on failure
|
;; match one and try the remaining on failure
|
||||||
(match-one v p g+s sk (match-gen-or-step v q g+s sk fk i) i))
|
(let ((fk2 (lambda () (match-gen-or-step v q g+s sk fk i))))
|
||||||
|
(match-one v p g+s sk (fk2) i)))
|
||||||
))
|
))
|
||||||
|
|
||||||
;; We match a pattern (p ...) by matching the pattern p in a loop on
|
;; We match a pattern (p ...) by matching the pattern p in a loop on
|
||||||
|
|
Loading…
Add table
Reference in a new issue