[Prev][Next][Index][Thread]

Re: small Q






> Bruce Hoult <bruce@hoult.org> writes:
> 
> How do you branch without "if"?
> In case you mean that you don't need "if" as a special form, I agree.


You code "if"

(define true (lambda (x y) (x)))
(define false (lambda (x y) (y)))

(define my-if (lambda (test t f) (test t f)))

(my-if true (lambda () (display "the true case") 
            (lambda () (display "the false case"))

(my-if false (lambda () (display "the true case") 
             (lambda () (display "the false case"))





References: