Hi - <br><br>a good starting point for loop construct is - <br><br><a href="http://schemecookbook.org/Cookbook/IdiomLoopingConstructs">http://schemecookbook.org/Cookbook/IdiomLoopingConstructs</a><br><br>Which talks about the usage of do and named let.
<br><br>I also find Jens' eager comprehension informative - <br><br><a href="http://scheme.dk/blog/2006/08/eager-comprehensions-for-black-belts.html">http://scheme.dk/blog/2006/08/eager-comprehensions-for-black-belts.html
</a><br><br>If you have a list, then even map or fold can work for you:<br><br>> (map <br> (lambda (x y) <br> (display y)) <br> '(0 1 2 3 4 5 6) ; value of i <br> '(Sun Mon Tue Wed Thu Fri Sat)) ; index <br>
<br>SunMonTueWedThuFriSat(#<void> #<void> #<void> #<void> #<void> #<void> #<void>)<br><br>The example probably doesn't fit your needs - but hopefully the idea is clear. <br><br>
<br><div><span class="gmail_quote">On 5/1/07, <b class="gmail_sendername">SpinyNorman</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I see that there is a standard way of getting date info such that<br>Sunday through Saturday are days 0 through 6. I want to generate text<br>for a week's worth of days. The part I am not clear on is how the<br>iteration should work. I *think* the relevant control word is "do".
<br>But of course, the HelpDesk isn't incredibly helpful when you search<br>for "do" -- it complains of too many matches. "(do" gives too few.<br><br>While I was looking up "begin," I did see some pretty good doc on
<br>"do," but it looks as if it allows for some very sophisticated<br>variations, whereas I need something really basic -- just count up<br>from zero, use the index for a calculation, and when you get to seven<br>
(or after passing six), stop. Also, some of the other functions used<br>in the "do" examples are not yet familiar to me.<br><br>Or should I use letrec?<br><br>Please feel free to point me at the appropriate place in the
<br>embarassment-of-courseware-riches.<br><br>_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme