chickadee » srfi-252 » list-generator-of

list-generator-of subgenerator #!optional max-lengthprocedure

Create an infinite generator that returns lists. The generator should return the empty list first. Then it should return lists containing values generated by subgenerator, with a length uniformly randomly distributed between 1 and max-length, if specified. If the max-length argument is not specified, the implementation may select the size range.

    (define list-gen (list-generator-of (integer-generator)))

    (list-gen) ; => '()
    (list-gen) ; => '(0 1 -1 ...)