Stephen Chang

Results 155 comments of Stephen Chang

I pushed the test if you want to try it.

I changed the test to ``` (for ([i 10]) (time (for* ([v (in-vertices g/scc)] [u (in-set (in-weighted-graph-neighbors g/scc v))] [w (in-set (in-weighted-graph-neighbors g/scc u))]) (void)))) ``` and I get the...

This behavior is consistent with my past experience. Relying on the implicit conversion is generally slower.

> Right, but the call to in-set ought to be much faster when it can be specialized by the for loop (unless in-set doesn't do that?). I don't understand this....

Oh I understand now. You're talking about [`expand-clause`](https://github.com/racket/racket/blob/master/racket/collects/racket/private/for.rkt#L181)? You're right it looks like it doesn't specialize sets.

I guess it's because "sets" are generic?

Agreed. I'll look into it.

Started a pull request: https://github.com/racket/racket/pull/1199

The algorithms are mostly standard imperative algorithms, i.e., lots of mutation. I'm ok if you want to make improvements to the docs but I'm not sure this is the right...

Thanks for the report. I'm wondering if `tsort` is the right function to use here? Since you already know the root, would a simple `bfs` give you what do want?...