From 2dc4a727901f180668b35625e21b35ed82c9e413 Mon Sep 17 00:00:00 2001 From: Linus Date: Wed, 2 Dec 2020 21:17:42 +0100 Subject: [PATCH] Added pattern matching ref variables now do pattern matching. This means that, say, the variable binding the (car cursor) in (in-list ...) can be a (ice-9 match) pattern: (loop/list (((a . b) (in-list '((1 ignore) (2 ignore) (3 ignore)))) a) ;; => (1 2 3) --- goof.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/goof.scm b/goof.scm index 4838f3d..77a1530 100644 --- a/goof.scm +++ b/goof.scm @@ -38,7 +38,8 @@ ((srfi srfi-1) #:select (circular-list)) (srfi srfi-71) (rnrs io simple) - (ice-9 futures)) + (ice-9 futures) + (ice-9 match)) (define-aux-syntaxes ;; Auxiliary syntax for the loop clauses @@ -297,7 +298,7 @@ (begin ff-cur ... (final-fun final-value ...)) - (let (refs ...) + (match-let (refs ...) (user-let () () (user-lets ...) (if (and user-whens ...) (let-kw-form name @@ -338,7 +339,7 @@ (begin ff-cur ... (final-fun final-value ...)) - (let (refs ...) + (match-let (refs ...) (user-let () () (user-lets ...) (if (and user-whens ...) (cond @@ -388,7 +389,7 @@ (begin ff-cur ... outer) - (let (refs ...) + (match-let (refs ...) (user-let () () (user-lets ...) (if (and user-whens ...) (cond @@ -423,7 +424,7 @@ (begin ff-cur ... outer) - (let (refs ...) + (match-let (refs ...) (user-let () () (user-lets ...) (if (and user-whens ...) (cond