5 ms·
> I LOATHE the fact that you traverse lists and vectors in completely different ways In Racket: (for ([x xs]) (displayln x)) This works for `xs` being a
by soegaard 3mo ago
> I LOATHE the fact that you traverse lists and vectors in completely different ways
In Racket:
(for ([x xs]) (displayln x))
This works for `xs` being a sequence, which includes lists and vectors.
Making the type explicit generates faster code:
(for ([x (in-list xs)]) (displayln x))
(for ([x (in-vector xs)]) (displayln x))
- bsder 3mo agoYes, this is the kind of thing why I like Racket and Clojure and so much of the Lisperati don't.