[racket-dev] exact nonnegative integers as sequences?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Apr 18 09:44:07 EDT 2011

I have written (for ([i N]) ..) many times only to remember that it's in-range. 


On Apr 18, 2011, at 9:25 AM, Matthew Flatt wrote:

> I often write
> 
> (for.... ([i (in-range N)]) ...)
> 
> In cases where the loop overhead is not significant (i.e., I don't care
> whether the compiler can tell that I'm iterating through integers), it
> would be nice to write just
> 
> (for.... ([i N]) ...)
> 
> which would require that integers are treated as sequences.
> 
> Would anyone object to making an exact, nonnegative integer `N' a
> sequence equivalent to `(in-range N)'?
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev




Posted on the dev mailing list.