Public feed #724897

same-parity

public text v1 · immutable
Raw Edit
·published 2007-10-03 23:11 UTC
rendered paste body
(define (same-parity fst . rst)
  (cond 
    ((null? rst) '())
    ((or (and (even? fst) (even? (car rst)))
         (and (odd? fst) (odd? (car rst))))
       (cons (car rst) (apply same-parity fst (cdr rst))))
    (else (apply same-parity fst (cdr rst)))))