Carl Sorensen <c_soren...@byu.edu> writes: > This is a good thought as a temporary workaround. However, it won't work > as-is, because fretboard-table is a hash table. We'd need to define a > hash-table copy function: > > (define (hash-table-copy my-table) > (let ((new-hash-table (make-hash-table 100))) > (hash-for-each (lambda (key value) > (hash-set! new-hash-table key value)) > my-table) > new-hash-table)) (hash-fold (lambda (key value tab) (hash-set! tab key value)) (make-hash-table 101) my-table))
Does not require a closure. And the size argument is recommended to be prime. Which 100 is not exactly. > cShape and aShape would then be defined as void music functions, which is > not shown in David's code above. > This is still only a temporary workaround, I think, because we should avoid > the hard-coded fretboard-table. Things would be better if we had either a) fret-board-table be (optionally?) a list of hashtables b) allow an entry 'parent in fret-board-table that will cause the specified table to be searched (recursively) when the original table did not deliver an appropriate key/value pair. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user