The other option is to use values:<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">(define (p x)<br>
(values (+ x 10)<br> (* x 10)))</span></div><div><br></div><div><br></div><div>That will return 2 values.</div><div><br></div><div>However, if you want to actually "display" the answers, you can:</div>
<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">(define (p x)<br>
(displayln (+ x 10))<br>
(displayln (* x 10)))</span></div><div><br></div><div><br></div><div>[]'s</div><div><br clear="all">Rodolfo Carvalho<br>
<br><br><div class="gmail_quote">On Thu, Jun 2, 2011 at 09:52, Hendrik Boom <span dir="ltr"><<a href="mailto:hendrik@topoi.pooq.com">hendrik@topoi.pooq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Jun 01, 2011 at 02:57:41PM -0700, Yingjian Ma wrote:<br>
> Hi all,<br>
><br>
> 1 I wrote<br>
><br>
> (define (p x)<br>
> (+ x 10)<br>
> (* x 10)<br>
> )<br>
><br>
> The result of (p 4) is 40. How can I display 14 and 40?<br>
<br>
</div>You could return a list instead of the individual numbers. The way<br>
you've coded it, the 14 is computed, then discarded. Then the 40 is<br>
computed and returned.<br>
<br>
In LISP I'd code (list (+ x 10) (* x 10)). I'm not quite sure if 'list'<br>
is still called 'list' in Scheme, though; a lot of the built-in function<br>
names have changed since the 60's, when I was heavily involved with<br>
Lisp. Look it up.<br>
<font color="#888888"><br>
-- hendrik<br>
</font><div><div></div><div class="h5">_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
</div></div></blockquote></div><br></div>