If I am understanding this right, data/enumerate's list/e combinator doing
a similar job. It might also be helpful.
Robby
On Sun, Oct 21, 2018 at 5:50 PM Jay McCarthy wrote:
> I think the best strategy would be to convert the generator to a
> sequence and then the sequence to a stream, then
I think the best strategy would be to convert the generator to a
sequence and then the sequence to a stream, then write a stream
cartesian product. The stream will cache the results of the generator.
On Sun, Oct 21, 2018 at 4:58 PM Matthew Butterick wrote:
>
> I suppose just putting in a hash
I suppose just putting in a hash isn't too bad.
#lang racket
(require racket/generator rackunit)
(define/contract (make-cartesian-generator gens)
((listof generator?) . -> . generator?)
(generator ()
(define solcache (make-hasheqv))
(let loop ([gens gens][genidx
3 matches
Mail list logo