<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br></div><div>Why would you want to use while in Scheme? You might as well use Java then :-) </div><div><br></div><div><br></div><div><br></div><br><div><div>On Jun 12, 2009, at 7:21 AM, emre berat nebioğlu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Can we use while or do while in drscheme.Just i wonder.I mean that<br><br>While(list != null)<br> list=list.cdr<br><br><div class="gmail_quote">On Fri, Jun 12, 2009 at 9:10 AM, Noel Welsh <span dir="ltr"><<a href="mailto:noelwelsh@gmail.com">noelwelsh@gmail.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Fri, Jun 12, 2009 at 7:05 AM, Captain___nemo<<a href="mailto:mmrasheed@gmail.com">mmrasheed@gmail.com</a>> wrote:<br> > Thanks a lot :)<br> ><br> > Won't it be inefficient building list for large values (say thousands<br> > instead of 10)? Isn't there any direct loop syntax in Scheme?<br> <br> </div>In PLT there are for comprehensions:<br> <br> (for ([i (in-range 10)]) ...)<br> <br> However, it is almost always bad style to use loops like you would in<br> Java. Functional programmers think of expressions creating values,<br> whereas Java's loops are fundamentally imperative. So rather than a<br> for comprehension, I would expect someone to use for/list or another<br> value returning comprehension.<br> <font color="#888888"><br> N.<br> </font><div><div></div><div class="h5">_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br> </div></div></blockquote></div><br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_________________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>For list-related administrative tasks:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span><a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a></div> </blockquote></div><br></body></html>