[racket-dev] provide expand-clause in racket/private/for.rkt

From: Stephen Chang (stchang at ccs.neu.edu)
Date: Fri Sep 6 00:45:40 EDT 2013

Hi dev,

I would like to provide (for-syntax) the "expand-clause" function in
racket/private/for.rkt. Would this cause any problems? Would anyone
object to this?

I have an implementation of for/X in my generic-bind library that uses
expand-clause and with it, the generic-bind ~for forms are as fast,
sometimes a little faster, than racket's for/X in some preliminary
testing. (Without access to expand-clause, sequence traversal is slow
--- the current planet-available version of my library uses
sequence-generate and is twice as slow.)

The "sometimes a little faster" is likely in part due to less
error-checking, but my implementation passes all the for/X unit tests
and so as is, it can reasonably be used in place of for/X.

Posted on the dev mailing list.