Hello! [email protected] (Ludovic Courtès) writes:
> I already changed my mind... :-) At the risk of looking silly, I changed again. > [email protected] (Ludovic Courtès) writes: > >> Indeed, if ‘vhash-assoc’ et al. are changed to return a vhash instead of >> a pair, then we have all that’s needed to do that: > > [...] > >> Thus I’m planning to make that change. [The ‘vhash-fold-matches’ above >> conses at each match whereas the attached one doesn’t, but that’s OK.] > > Thinking more about it, I think I’d rather keep ‘vhash-assoc’ & co. as > they are, and add ‘vhash-assoc*’ & co., which would return a vhash. Commit 927bf5e8cc0af9515797ebab6d9ba162bef23c2a is roughly the original patch. http://git.savannah.gnu.org/cgit/guile.git/commit/?id=927bf5e8cc0af9515797ebab6d9ba162bef23c2a I still think that ‘vhash-assoc*’ could/should be added eventually, but it’s only useful for programs willing to access only *some* of the values associated with a given key, which I expect to be uncommon. Accessing the first value associated with a key (‘vhash-assoc’) or all the values associated with a key (the new ‘vhash-fold*’) seems more common. Thanks, Ludo’.
