[racket] Futures and shared data structure

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Dec 20 17:17:38 EST 2010

On Mon, Dec 20, 2010 at 3:56 PM, Noel Welsh <noelwelsh at gmail.com> wrote:
> On Mon, Dec 20, 2010 at 9:51 PM, Robby Findler
> <robby at eecs.northwestern.edu> wrote:
>> The expanded code doens't look very good, imo, tho, so perhaps whoever
>> recently was working on this can clean this part up too.
>
> I have a name ;-P  Perhaps you could elaborate on "doesn't look very
> good". I spent a little bit of time optimising it.

I'm sorry Noel. I had forgotten who did that.

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.

Robby


Posted on the users mailing list.