[plt-scheme] dot notation issue

From: Lisa Gandy (redlmg98 at hotmail.com)
Date: Fri Feb 6 18:46:14 EST 2009

Hi,
I have the following code..

(define (same-parity p . x)
    (define ind (remainder p 2))
    (cond ((null? x) '())
          ((= ind (remainder (car x) 2))
          (cons (car x) (same-parity p (cdr x))))
          (else (same-parity p (cdr x)))))

I thought that x would be passed in as a list however
when I run this function I get...
(require (lib "trace.ss"))
> (trace same-parity)
> (same-parity 1 2 3 4 5)
|(same-parity 1 2 3 4 5)
|(same-parity 1 (3 4 5))

What is going on here?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090206/ec276657/attachment.html>

Posted on the users mailing list.