Subject: Re: Newbie question on Scheme
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 2000/03/07
Newsgroups: comp.lang.scheme
Message-ID: <8a2i6d$ic2gk$1@fido.engr.sgi.com>
Yul Pan <yuriypan@uclink4.berkeley.edu> wrote [after correction]:
+---------------
| I would suggest defining your own "keep-if" procedure.
| Your main function would look something like:
| (define (same-parity . z)
|     (if (odd? (car z))
|         (keep-if odd? z)
|        (keep-if even? z)))
+---------------

Or even:

  (define (same-parity . z)
    (keep-if (if (odd? (car z)) odd? even?) z))


-Rob

-----
Rob Warnock, 41L-955		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043