From bcb098e8eb18637b6999789585a38ff9168de9d5 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 3 Jul 2022 14:37:10 -0700 Subject: Add a diff library. I was hesitant to add a diff library, but it was surprisingly easy. A straightforward application of dynamic programming. --- csc/match.csc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'csc/match.csc') diff --git a/csc/match.csc b/csc/match.csc index ad9b56a..f6ed477 100644 --- a/csc/match.csc +++ b/csc/match.csc @@ -25,7 +25,7 @@ (define (matcher x) (unless (predicate x) (raise *no-match*)) - (list (field-getter* x) ...)))))) + (list (cons 'type 'name) (cons 'field-name* (field-getter* x)) ...)))))) (define-syntax match-pattern @@ -51,7 +51,7 @@ (match-pattern (car y) pattern result result* ...) (raise *no-match*)))) ((match-pattern x (% record-matcher . patterns) result result* ...) - (match-pattern (record-matcher x) patterns result result* ...)) + (match-pattern (map cdr (cdr (record-matcher x))) patterns result result* ...)) ((match-pattern x (pattern . rest) result result* ...) (let ((y x)) (if (pair? y) -- cgit v1.3.1