<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Yingjian, if you point us to the web page with the problems, we might be able to help you more effectively. </div><div><br></div><div><br></div><div><br></div><br><div><div>On May 31, 2011, at 12:01 PM, Yingjian Ma wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Marijn,</div>
<div> </div>
<div>I am new to Racket. I did not expect that output is "#<procedure:...uments...". It is like an error message to me.</div>
<div> </div>
<div>Because the restrictions on this function (and on others), I need to study more about Racket to go further. I also need to code a function to remove the duplicates from a list. There is a such function in Racket but I cannot use it. <br>
<br></div>
<div class="gmail_quote">On Tue, May 31, 2011 at 1:03 AM, Marijn <span dir="ltr"><<a href="mailto:hkBst@gentoo.org">hkBst@gentoo.org</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>Hi Yingjian,<br>
<div class="im"><br>On 05/31/11 01:17, Yingjian Ma wrote:<br>> Hi All,<br>><br>> I wrote a piece of code to count the occurrance of a letter in a list. But<br>> it gave me an error saying "#<procedure:...uments..."<br>
<br></div>What makes you think it's an error?<br>
<div class="im"><br>> The code is below:<br>><br>> (define (count-matches s l)<br>> (cond<br>> [(empty? l) 0]<br>> [(equal? s (first l)) (lambda (i)(+ i 1))]<br>> [else (count-matches s (rest l))]))<br>
<br></div>Part of this code reads:<br><br>compare s to the first element of list l and if they are equal return a<br>function that returns its argument plus one (and forget about the rest<br>of the list).<br><br>Marijn<br>
<br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v2.0.17 (GNU/Linux)<br>Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br><br>iEYEARECAAYFAk3koL8ACgkQp/VmCx0OL2ztFwCfUG1WrfbagBXTp7F9prAvvaL8<br>
sycAoJWBleSTJ/eE2CExwx1zt71Z1Lks<br>=e+cf<br>-----END PGP SIGNATURE-----<br></blockquote></div><br>
_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://lists.racket-lang.org/listinfo/dev">http://lists.racket-lang.org/listinfo/dev</a></blockquote></div><br></body></html>