[racket] Futures and shared data structure

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Dec 20 20:03:48 EST 2010

At Mon, 20 Dec 2010 16:17:38 -0600, Robby Findler wrote:
> I don't think your changes had anything to do with the "doens't look
> very good". But since you asked, if you look at the fully expanded
> version of
> 
>   (λ (v) (for ([x (in-vector v)]) x))
> 
> you'll see it begins like this:
> 
>     (let-values (((vec len)
>                   (let-values (((vec) v))
>                     (if (#%app vector? vec)
>                       (#%app void)
>                       (let-values () (#%app in-vector vec)))
>                     (#%app values vec (#%app unsafe-vector-length vec)))))
> 
> with an unnecessary use of multiple values that just binds 'vec' to
> 'vec' and otherwise could avoid multiple values and thus be
> future-safe.

I'm inclined to blame the compiler for not optimizing away the use
`values', so I'll fix it.



Posted on the users mailing list.