[racket-dev] for loop singleton optimization
It would be great to optimize singletons out of comprehensions, since I (and probably others) have macros that expand into singleton constructors that are much better suited to just be a rebinding.
> (time (for ([n (in-range 1 1000000)]) (for ([k (in-set (set n))]) (random k))))
cpu time: 340 real time: 338 gc time: 16
> (time (for ([n (in-range 1 1000000)]) (for ([k (in-value n)]) (random k))))
cpu time: 120 real time: 118 gc time: 0
Is this easily added to for.rkt?
-Ian