[racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Aug 15 10:37:44 EDT 2012

At Wed, 15 Aug 2012 07:54:16 -0600, Neil Toronto wrote:
> I wouldn't want to because `for/vector' is currently broken when 
> #:length is given. (See PR 13029 and PR 13030.)
> 
> I think the only way to fix it is to implement it like I did: expand to 
> plain `for:' and mutate an external index.

I pushed a repair that doesn't involve `set!'.

At Wed, 15 Aug 2012 10:05:47 -0400, Sam Tobin-Hochstadt wrote:
> On Wed, Aug 15, 2012 at 9:54 AM, Neil Toronto <neil.toronto at gmail.com> wrote:
> > On the plus side, mine's about
> > twice as fast. It expands to plain `for:' and bangs values into a growable
> > vector.
> 
> In that case, presumably we should change `for/vector` in
> `racket/base` to the faster version.
> 
> Matthew, does this seem reasonable?

I can change `for/vector' to avoid lists and grow a vector. On my test
of 1000 elements, the difference is more like x1.5 instead of x2,
though.

As for the problem with padding `#:length'-specified vectors with 0,
maybe there should be a `#:default' clause to provide the fill value,
instead?


Posted on the dev mailing list.