From 11b0796187a8307c37ecbcb2abd034e5a5f84e25 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 10 Dec 2013 03:21:29 -0800 Subject: [PATCH] add syntax-error --- piclib/built-in.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/piclib/built-in.scm b/piclib/built-in.scm index ee5366dd..4a87c37a 100644 --- a/piclib/built-in.scm +++ b/piclib/built-in.scm @@ -227,6 +227,11 @@ (begin ,@(cdar clauses)) ,(loop (cdr clauses)))))))))) + (define-syntax syntax-error + (er-macro-transformer + (lambda (expr rename compare) + (apply error (cdr expr))))) + (define-syntax define-auxiliary-syntax (er-macro-transformer (lambda (expr r c) @@ -246,9 +251,8 @@ quasiquote unquote unquote-splicing and or cond case else => - do - when unless - _ ...)) + do when unless + _ ... syntax-error)) (import (picrin macro) (picrin core-syntax)) @@ -257,9 +261,8 @@ quasiquote unquote unquote-splicing and or cond case else => - do - when unless - _ ...) + do when unless + _ ... syntax-error) (define (any pred list) (if (null? list)