Guile Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheme style auto-resizing hashtable (fwd)



Jay Glascoe <jglascoe@jay.giss.nasa.gov> writes:

> Perl hackers and Pythoneers seem to get by pretty well with just the
> "hash->keys" approach.

Actually, FWIW, perl has three options:

  keys() -- gives you a list of the keys
  values() -- gives you a list of the values
  each() -- is an iterator

Note that their justification for each() makes sense (at least given
that perl can tie() hashes to DBM files):

               Note that functions such as keys() and values()
               may return huge array values when used on large
               DBM files.  You may prefer to use the each()
               function to iterate over large DBM files.
               Example:

                   # print out history file offsets
                   dbmopen(%HIST,'/usr/lib/news/history',0666);
                   while (($key,$val) = each %HIST) {
                       print $key, ' = ', unpack('L',$val), "\n";
                   }
                   dbmclose(%HIST);

-- 
Rob Browning <rlb@cs.utexas.edu> PGP=E80E0D04F521A094 532B97F5D64E3930

Guile Home | Main Index | Thread Index