38 lines
777 B
Scheme
38 lines
777 B
Scheme
|
(define (mainstage-with-if x y)
|
||
|
(print "this is mainstage-with-if")
|
||
|
(if (< x y) (stage11 x) (stage21 y)))
|
||
|
|
||
|
(define (mainstage-with-procedure-if x y)
|
||
|
(print "this is mainstage-with-if")
|
||
|
(procedure-if (< x y) (stage11 x) (stage21 y)))
|
||
|
|
||
|
(define (stage11 x)
|
||
|
(print "this is stage11")
|
||
|
(stage12 x))
|
||
|
|
||
|
(define (stage21 x)
|
||
|
(print "this is stage21")
|
||
|
(stage22 x))
|
||
|
|
||
|
(define (stage12 x)
|
||
|
(print "this is stage12")
|
||
|
(stage13 x))
|
||
|
|
||
|
(define (stage22 x)
|
||
|
(print "this is stage22")
|
||
|
(stage23 x))
|
||
|
|
||
|
(define (stage13 x)
|
||
|
(print "this is stage13")
|
||
|
x)
|
||
|
|
||
|
(define (stage23 x)
|
||
|
(print "this is stage23")
|
||
|
x)
|
||
|
|
||
|
(define (procedure-if predicate then-clause else-clause)
|
||
|
(cond (predicate then-clause) (else else-clause)))
|
||
|
|
||
|
(print (mainstage-with-if 1 2))
|
||
|
(print (mainstage-with-procedure-if 1 2))
|