Re: [racket] Loop in Racket

2010-06-28 Thread Stephen Bloch
What is the reason for not offering a looping construct in racket? For example, something like: (loop (i 1 10) (print i)) Just for the masses, it seems simpler to use. Simpler than what? For what application? The classic C/C++/Java "for" loop was designed for, and is almost always used f

Re: [racket] Loop in Racket

2010-06-27 Thread John Clements
On Jun 27, 2010, at 6:32 PM, Brad Long wrote: > Dear racketeers, > > What is the reason for not offering a looping construct in racket? For > example, something like: > > (loop (i 1 10) (print i)) > It's there: (for/list ([i (in-range 1 10)]) i) prints out '(1 2 3 4 5 6 7 8 9) ... also

Re: [racket] Loop in Racket

2010-06-27 Thread Neil Van Dyke
FWIW, I like to assert that the familiar "FOR A = 1 TO 10" is actually not often needed in idiomatic Scheme. More often, you're processing a sequence, or you're doing functional programming such that you need to recurse anyway to avoid mutation, or you need premature exits sometimes. One poss

Re: [racket] Loop in Racket

2010-06-27 Thread Matthias Felleisen
Plus loops per se are evil -- opium for the masses if you so wish. -- Matthias On Jun 27, 2010, at 9:34 PM, Robby Findler wrote: > Please see 'for' in the docs. Here's the relevant section of the Guide: > > http://docs.racket-lang.org/guide/for.html > > Robby > > On Sun, Jun 27, 2010 at 8:

Re: [racket] Loop in Racket

2010-06-27 Thread Robby Findler
Please see 'for' in the docs. Here's the relevant section of the Guide: http://docs.racket-lang.org/guide/for.html Robby On Sun, Jun 27, 2010 at 8:32 PM, Brad Long wrote: > Dear racketeers, > > What is the reason for not offering a looping construct in racket? For > example, something like: > >