<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; "><div style="font-family: Calibri, sans-serif; ">I'm trying to teach myself scheme (racket) and decided to try writing fizzbuzz. My program mostly works, but instead of getting a single list, I get a list with a dot before the last list item, which I assume means I've got a 'cons' at the end rather than just one list. What am I doing wrong? Any general comments on style or approach also welcome.</div><div style="font-family: Calibri, sans-serif; "><br></div><div style="font-family: Calibri, sans-serif; ">Thanks,</div><div style="font-family: Calibri, sans-serif; "><br></div><div style="font-family: Calibri, sans-serif; ">Leonard</div><div style="font-family: Calibri, sans-serif; "><br></div><div><div><font class="Apple-style-span" face="Courier">#lang racket</font></div><div><font class="Apple-style-span" face="Courier"><br></font></div><div><font class="Apple-style-span" face="Courier"><br></font></div><div><font class="Apple-style-span" face="Courier">(define (printer num)</font></div><div><font class="Apple-style-span" face="Courier"> (cond((and (= 0 (remainder num 3)) (= 0 (remainder num 5))) 'fizzbuzz)</font></div><div><font class="Apple-style-span" face="Courier"> ((= 0 (remainder num 3)) 'fizz)</font></div><div><font class="Apple-style-span" face="Courier"> ((= 0 (remainder num 5)) 'buzz)</font></div><div><font class="Apple-style-span" face="Courier"> (else num)))</font></div><div><font class="Apple-style-span" face="Courier"><br></font></div><div><font class="Apple-style-span" face="Courier">(define (fizzbuzz limit)</font></div><div><font class="Apple-style-span" face="Courier"> (define (helper current limit)</font></div><div><font class="Apple-style-span" face="Courier"> (cond ((>= current limit) (printer limit))</font></div><div><font class="Apple-style-span" face="Courier"> (else (cons (printer current)</font></div><div><font class="Apple-style-span" face="Courier"> (helper (+ 1 current) limit)))))</font></div><div><font class="Apple-style-span" face="Courier"> (helper 1 limit))</font></div><div><font class="Apple-style-span" face="Courier"><br></font></div><div><font class="Apple-style-span" face="Courier">(fizzbuzz 10)</font></div></div><div style="font-family: Calibri, sans-serif; "><br></div><div style="font-family: Calibri, sans-serif; "><div>'(1 2 fizz 4 buzz fizz 7 8 fizz . buzz)</div><div>> </div></div></body></html>