tisimst <[email protected]> writes:
> On Wed, Mar 16, 2016 at 10:11 AM, Kieren MacMillan [via Lilypond] <
> [email protected]> wrote:
>
>> Hi David,
>>
>> > violin.2 = { c d }
>> > will work, as will \violin.2 (as of issue 4797) or \violin.#(+ 1 1)
>>
>> Wow! That’s wonderful news.
>> Thanks, as always, for your excellent work on improving Lilypond.
>
>
> +1 (x10)!
>
> I don't think I'll ever use the #(+ 1 1) form to auto-generate part
> variables, but that's cool, nonetheless. Absolutely fantastic, David! Does
> this work too (just trying to understand the limitations of this syntax):
>
> violin.#(+ 1 1) = { c d }
>
> or just when the variable is called, like you mentioned?
This will work as well. As will
violin.I = { c d }
violin.II = { e f }
which is sort of equivalent to
violin = #`((II . ,#{ e f #}) (I . ,#{ c d #}))
Whether your dotted lists are symbolic or numeric, they will create
alists which are consequently less efficient to access than separate
variables as you would do when writing violin_I and violin_II . I'm
still fuzzy about schemes allowing to optionally use arrays or hash
tables rather than alists.
This is definitely one area where "language design" is easier to do when
using Lua rather than Scheme, with its "there is only one data
structure, the table" principle.
--
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user