[racket-dev] exact nonnegative integers as sequences?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Apr 18 09:34:34 EDT 2011

FWIW, I don't like that any of these 'in-*' thigns are optional. I was
recently reading over a script that was used to build web pages from
the output of testing runs for my compilers class and there were
several nested for loops without in-* thingies and it was painfully
difficult for me to reconstruct what the contracts of the functions
were because of that. (These loops were iterating over the output of
some other, long-lost script that generated the output and I was
writing an adapter from the new, cleaned up scripts to this one.)

So I'd be happier if you asked to get rid of all of any possibility to
avoid writing 'in-*'. Even very short names, eg using the natural
number unicode character would be better than using nothing.

Robby

On Mon, Apr 18, 2011 at 8: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), 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.