RosettaCodeData/Task/Short-circuit-evaluation/Racket/short-circuit-evaluation.rkt
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

18 lines
284 B
Racket

#lang racket
(define (a x)
(display (~a "a:" x " "))
x)
(define (b x)
(display (~a "b:" x " "))
x)
(for* ([x '(#t #f)]
[y '(#t #f)])
(displayln `(and (a ,x) (b ,y)))
(and (a x) (b y))
(newline)
(displayln `(or (a ,x) (b ,y)))
(or (a x) (b y))
(newline))