[plt-scheme] Re: From hash-table to generator

From: Kyle Smith (airfoil at bellsouth.net)
Date: Fri May 11 20:30:46 EDT 2007

> (define (hash-table->generator ht)
>    (let ([xs (hash-table->list ht)])
>      (lambda ()
>        (cond
>          [(null? xs) #f]
>          [else       (let ([x (car xs)])
>                        (set! xs (cdr xs))
>                        x)]))))
Hi Jens,

I'm trying to reproduce these results;

Unless I missed the definition in an earlier post,
I'm not sure how you're defining:

hash-table->list

I can't seem to find it in the Help Desk, so I'm assuming
it's yours.  Please post the definition, or a reference to
which library it comes from.

Thanks,

--kyle
 






Posted on the users mailing list.