8.14
1.3.1 Sequence
Source code at sequence.rkt
The sequence is a generator for integers.
(define (make-sequence) (let-values ([(_ get-next) (sequence-generate (in-naturals 101))]) get-next))
The sequence supplies new ids.
(test-case: "generates ids" (let ([sequence (make-sequence)]) (check-equal? (sequence) 101) (check-equal? (sequence) 102) (check-equal? (sequence) 103)))