diff --git a/module/mes/base-0.mes b/module/mes/base-0.mes index 7db153e5..727522e6 100644 --- a/module/mes/base-0.mes +++ b/module/mes/base-0.mes @@ -63,8 +63,8 @@ (if (pair? (cdr (car clauses))) (if (eq? (car (cdr (car clauses))) '=>) (append2 (cdr (cdr (car clauses))) '(test)) - (list (cons 'lambda (cons '() (car clauses))))) - (list (cons 'lambda (cons '() (car clauses))))) + (list (cons 'lambda (cons '() (cons 'test (cdar clauses)))))) + (list (cons 'lambda (cons '() (cons 'test (cdar clauses)))))) (if (pair? (cdr clauses)) (cons 'cond (cdr clauses))))))) (car (car clauses))))) diff --git a/tests/base.test b/tests/base.test index 784fe9c4..3ac1e130 100755 --- a/tests/base.test +++ b/tests/base.test @@ -61,6 +61,10 @@ exit $? (pass-if "cond 2" (seq? (cond (#f)) *unspecified*)) (pass-if "cond 3" (seq? (cond (#t 0)) 0)) (pass-if "cond 3" (seq? (cond (#f 1) (#t 0)) 0)) + (pass-if-equal "cond side effect" + 1 + (let ((i 0)) + (cond ((set! i (1+ i)) i)))) (pass-if-equal "cond => " 0 (let ((lst '(0 1 2))) (define (next)