[racket-dev] exact nonnegative integers as sequences?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Mon Apr 18 09:36:27 EDT 2011

On Mon, Apr 18, 2011 at 9:25 AM, Matthew Flatt <mflatt at cs.utah.edu> 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),

Or in cases where you're using Typed Racket, and the compiler can tell
exactly what you're doing. :)

> 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)'?

I am very strongly in favor of this.
sam th
samth at ccs.neu.edu

Posted on the dev mailing list.