> On Apr 15, 2016, at 1:20 PM, Andreas Rottmann <a.rottm...@gmx.at> wrote: > > Depending on the number of entries in each nesting level, and other > (performance/space) tradeoffs, hash tables might be a good fit as an > associative array data structure: > > https://www.gnu.org/software/guile/manual/html_node/Hash-Tables.html > http://srfi.schemers.org/srfi-69/srfi-69.html > http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-14.html > > Guile 2.0 supports all three of these APIs -- choosing between them is > mostly important if you care about portability to different Scheme > implementations (which I'd guess is not high priority in the context of > lilypond).
Thanks for your help. It looks like a hash table containing nested vectors should work well for this case. I think I’ll just stick with the syntax from the Guile manual. I don’t suppose there's any general guidance on how big a given hash table should be for it to make sense to use a hash table, in terms of performance/space tradeoffs? Also good to know about the boxes from SRFI-111. They might come in handy, especially when rewriting C++ code in Scheme. -Paul