Fixing racket/match by removing errorneous optimization with test that shows it is broken
This commit is contained in:
parent
9036e9ec61
commit
41307f1346
|
@ -447,7 +447,8 @@
|
|||
;; and compile each block with a reference to its continuation
|
||||
[else
|
||||
(let*-values
|
||||
([(rows vars) (reorder-columns rows vars)]
|
||||
(;; XXX This is broken.
|
||||
#;[(rows vars) (reorder-columns rows vars)]
|
||||
[(fns)
|
||||
(let loop ([blocks (reverse (split-rows rows))] [esc esc] [acc null])
|
||||
(if (null? blocks)
|
||||
|
|
|
@ -171,6 +171,22 @@
|
|||
[_ #f])))
|
||||
(test-case "app pattern"
|
||||
(check = 4 (match 3 [(app add1 y) y])))
|
||||
(test-case "app pattern (step 1)"
|
||||
(check = 2 (match (list 1 3)
|
||||
[(list 0 (app add1 y)) y]
|
||||
[(list 1 (app sub1 y)) y])))
|
||||
(test-case "app pattern (step 2a)"
|
||||
(check = 2 (match (cons 1 3)
|
||||
[(cons 0 (app error y)) y]
|
||||
[(cons 1 (app sub1 y)) y])))
|
||||
(test-case "app pattern (step 2a)"
|
||||
(check = 2 (match (vector 1 3)
|
||||
[(vector 0 (app error y)) y]
|
||||
[(vector 1 (app sub1 y)) y])))
|
||||
(test-case "app pattern (step 2)"
|
||||
(check = 2 (match (list 1 3)
|
||||
[(list 0 (app error y)) y]
|
||||
[(list 1 (app sub1 y)) y])))
|
||||
(test-case "struct patterns"
|
||||
(let ()
|
||||
(define-struct point (x y))
|
||||
|
|
Loading…
Reference in New Issue
Block a user