This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Hash table keys?


Greg Badros <gjb@cs.washington.edu> writes:

> How do I get at a list of the keys in a guile hash table?  Is there a
> standard supported proc (e.g., hash-table->alist would be nice)?
> 

(define hash-table->alist 
        (lambda (table) (hash-fold acons () table)))

will do the trick.

-- 
Greg: the problem with thinking "I'll look at that a bit more closely
      in a few minutes" is that it quickly becomes a few weeks.