Support OR in syntax-check.
authorChris Hanson <org/chris-hanson/cph>
Thu, 21 Dec 2017 06:17:41 +0000 (22:17 -0800)
committerChris Hanson <org/chris-hanson/cph>
Thu, 21 Dec 2017 06:17:41 +0000 (22:17 -0800)
src/runtime/syntax-check.scm

index d8f41576875d16c8121d861e0789cb60696149b4..1db64bddf5d7939358b13fd9078113182ebbffec 100644 (file)
@@ -85,6 +85,12 @@ USA.
                           (syntax-match? (cddr pattern) (cdr object)))
                      (syntax-match? (cddr pattern) object))
                  (match-error)))
+            ((or)
+             (if (list? (cdr pattern))
+                 (any (lambda (pattern)
+                        (syntax-match? pattern object))
+                      (cdr pattern))
+                 (match-error)))
             ((QUOTE)
              (if (and (pair? (cdr pattern))
                       (null? (cddr pattern)))