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>