From: Chris Hanson Date: Sun, 25 Mar 2018 15:36:58 +0000 (-0700) Subject: Tweak spar patterns. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~181 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=56d7d46579fbe6904e2697cb303c628d834e3c02;p=mit-scheme.git Tweak spar patterns. * Rename (quote ) to (noise ). * Rename (keyword ) to (noise-keyword ). * Implement (keyword ) that matches and then pushes it. --- diff --git a/src/runtime/mit-macros.scm b/src/runtime/mit-macros.scm index d23432742..3f1dbe8be 100644 --- a/src/runtime/mit-macros.scm +++ b/src/runtime/mit-macros.scm @@ -371,7 +371,7 @@ USA. (delay (scons-rule (let ((action-pattern - '(if (keyword =>) + '(if (noise-keyword =>) (and (values apply) any) (and (values eval) @@ -379,7 +379,7 @@ USA. `(any (list (* (list (elt (list (elt (* any))) ,action-pattern)))) - (or (list (elt (keyword else) + (or (list (elt (noise-keyword else) ,action-pattern)) (values #f)))) (lambda (expr clauses else-clause) diff --git a/src/runtime/syntax-parser.scm b/src/runtime/syntax-parser.scm index 67e4bca12..4e1370013 100644 --- a/src/runtime/syntax-parser.scm +++ b/src/runtime/syntax-parser.scm @@ -488,9 +488,12 @@ USA. ('('if form form form) (apply :if (map loop (cdr pattern)))) ('('or * form) (apply :or (map loop (cdr pattern)))) ('('and * form) (apply :seq (map loop (cdr pattern)))) - ('('quote form) (:match-elt (:eqv?) (cadr pattern) (:form))) - ('('keyword identifier) + ('('noise form) (:match-elt (:eqv?) (cadr pattern) (:form))) + ('('noise-keyword identifier) (:match-elt (:compare) (cadr pattern) (:form))) + ('('keyword identifier) + (:seq (:match-elt (:compare) (cadr pattern) (:form)) + (:push (cadr pattern)))) ('('values * form) (apply :push (map convert-spar-arg (cdr pattern)))) ('('value-of + form)