Ticket #192: 0001-Only-the-last-clause-in-COND-may-be-an-ELSE-clause.patch

File 0001-Only-the-last-clause-in-COND-may-be-an-ELSE-clause.patch, 915 bytes (added by Jim Ursetto, 14 years ago)
  • expand.scm

    From c8b9a610f3532f466c5ac4454d50151461d064ef Mon Sep 17 00:00:00 2001
    From: zbigniew <zbigniewsz@gmail.com>
    Date: Thu, 25 Mar 2010 22:37:17 -0500
    Subject: [PATCH 1/2] Only the last clause in COND may be an ELSE clause
    
    ---
     expand.scm |    5 ++++-
     1 files changed, 4 insertions(+), 1 deletions(-)
    
    diff --git a/expand.scm b/expand.scm
    index 207cd25..0641f51 100644
    a b  
    10731073            (let ((clause (car clauses))
    10741074                  (rclauses (cdr clauses)) )
    10751075              (##sys#check-syntax 'cond clause '#(_ 1))
    1076               (cond ((c %else (car clause)) `(##core#begin ,@(cdr clause)))
     1076              (cond ((c %else (car clause))
     1077                     (if (pair? rclauses)
     1078                         (syntax-error "(else ...) must be the last clause")
     1079                         `(##core#begin ,@(cdr clause))))
    10771080                    ((null? (cdr clause)) `(,%or ,(car clause) ,(expand rclauses)))
    10781081                    ((c %=> (cadr clause))
    10791082                     (let ((tmp (r 'tmp)))