scsh-0.6/ps-compiler/prescheme/test/goto.scm

21 lines
302 B
Scheme
Raw Normal View History

2003-05-01 06:21:33 -04:00
; Copyright (c) 1994 by Richard Kelsey. See file COPYING.
(define (odd? x)
(cond ((= x 0)
#f)
; ((= x 100)
; (foo))
(else
(goto even? (- x 1)))))
(define (even? x)
(if (= x 0)
#t
(goto odd? (- x 1))))
(define (test x)
(if (odd? (+ x 1))
(error "an even number" x)))