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

From: Neil Toronto (neil.toronto at gmail.com)
Date: Wed Aug 15 15:30:24 EDT 2012

On 08/15/2012 08:05 AM, Sam Tobin-Hochstadt wrote:
> On Wed, Aug 15, 2012 at 9:54 AM, Neil Toronto <neil.toronto at gmail.com> wrote:
>> BTW, what do you think of deprecating result annotations and using body
>> annotations instead?
>
> I'm not sure yet.

This short exercise might convince you: implement `for/vector:' without 
a body type annotation in terms of `for/list:' or `for/fold:'. Don't use 
internal or unpublished Typed Racket goodies.

There's an O(n^2) solution that converts the vector to a list and back 
every iteration, but it doesn't count.

Neil ⊥


Posted on the dev mailing list.