aboutsummaryrefslogtreecommitdiffstats
path: root/csc/match.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-07-22 12:00:46 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-07-22 12:00:46 -0700
commit9f8ae9d1de7988299fccb9a6e2673bf147c6d9eb (patch)
tree3ea426b72ad1c9588a11396eebf735e86256acdd /csc/match.csc
parentPerform argument conversion. (diff)
downloadchromatopelma-9f8ae9d1de7988299fccb9a6e2673bf147c6d9eb.tar.zst
Fix a bug in matching record types.
Running the record matcher has a side-effect (raising *no-match*), so we call it ahead of time to ensure a consistent order of evaluation.
Diffstat (limited to 'csc/match.csc')
-rw-r--r--csc/match.csc3
1 files changed, 2 insertions, 1 deletions
diff --git a/csc/match.csc b/csc/match.csc
index 116204f..96ec4d3 100644
--- a/csc/match.csc
+++ b/csc/match.csc
@@ -51,7 +51,8 @@
(match-pattern (car y) pattern result result* ...)
(raise *no-match*))))
((match-pattern x (% record-matcher . patterns) result result* ...)
- (match-pattern (map cdr (cdr (record-matcher x))) patterns result result* ...))
+ (let ((x* (record-matcher x)))
+ (match-pattern (map cdr (cdr (record-matcher x))) patterns result result* ...)))
((match-pattern x (pattern . rest) result result* ...)
(let ((y x))
(if (pair? y)