@@ 15,7 15,6 @@
(define-module (syntax define)
#:replace ((new-lambda . lambda)
(new-define . define)
- (new-begin . begin)
(new-let . let)
(new-let* . let*)
(new-letrec . letrec)
@@ 39,13 38,6 @@
((_ name expr) (define name expr))))
-(define-syntax new-begin
- (syntax-rules ()
- ((_) (if #f #f))
- ((_ one-thing-only)
- one-thing-only)
- ((_ stuff ...)
- (parse-body () stuff ...))))
(define-syntax new-let
(syntax-rules ()
@@ 135,8 127,15 @@
(nc o (c ... (else (parse-body o body ...)))))
((nc o (c ...) (test => expr) . rest)
(nc o (c ... (test => expr)) . rest))
+ ((nc o c (test => expr ...) . rest)
+ (syntax-error "Bad cond clause form " (test => expr ...) o))
+ ;; Remove these 2 clauses if porting to a scheme without this form
((nc o (c ...) (test guard => expr) . rest)
(nc o (c ... (test guard => expr)) . rest))
+ ((nc o c (test guard => expr ...) . rest)
+ (syntax-error "Bad cond clause form " (test guard => expr ...) o))
+
+
((nc o (c ...) (test body body* ...) . rest)
(nc o (c ... (test (parse-body o body body* ...))) . rest))
@@ 165,12 164,12 @@
((pb2 orig (clauses ...) () (new-define (name args ...) body ...) . rest)
(pb2 orig (clauses ... (name (new-lambda (args ...) body ...))) () . rest))
((pb2 o (clauses ...) () (new-define var body ...) . rest)
- (pb2 o (clauses ... (var (new-begin body ...))) () . rest))
+ (pb2 o (clauses ... (var (begin body ...))) () . rest))
((pb2 orig (clauses ...) (expr ...) (new-define (name args ...) body ...) . rest)
(pb2 orig (clauses ... (_ (begin expr ...)) (name (new-lambda (args ...) body ...))) () . rest))
((pb2 o (clauses ...) (expr ...) (new-define var body ...) . rest)
- (pb2 o (clauses ... (_ (begin expr ...)) (var (new-begin body ...))) () . rest))
+ (pb2 o (clauses ... (_ (begin expr ...)) (var (begin body ...))) () . rest))
((pb2 o (clauses ...) (expr ...) expr* . rest)
(pb2 o (clauses ...) (expr ... expr*) . rest))))