If you use Racket, then there is no need to use do , which has never been popular with insiders. There are a number of iterators out there - look for in docs and things starting with for . For example, your code comes down to
#lang racket (define (values-before x vector) (for/list ([y (stop-before (in-vector vector) (lambda (y) (eqv? xy)))]) y))
(If you really want to use do , then you are missing a couple of partners around the test, and you need to add a binding for the battery.)
source share