In Racket:
(for ([x xs]) (displayln x))
Making the type explicit generates faster code:
(for ([x (in-list xs)]) (displayln x)) (for ([x (in-vector xs)]) (displayln x))
In Racket:
This works for `xs` being a sequence, which includes lists and vectors.Making the type explicit generates faster code: