Werner LEMBERG <w...@gnu.org> writes:

>> I propose developing the infrastructure that allows saying
>> violin = \makeVector 2
>> and afterwards using
>> \violin 1 = { ... } % backslash is no typo here
>> as well as { ... \violin 1 }
>> It will be possible to use arbitrary numbers (or Scheme expressions)
>> as index, and this would straightforwardly map to a Scheme vector of
>> size 2 called violin.
>
> Nice idea!  A minor nit: I would like to somehow `bind' the number to
> the variable, something like `\violin{1}', to emphasize the
> vector-ness.  Is this possible?

Uh, at the moment, nothing is possible since no line of code has been
written.  If you are interested about what goes on in my head, you'd be
able to use either \violin1 or \violin#1 naturally (or \violin$1 if you
insist).  \violin{1} would not work as long as {1} would not, by itself,
evaluate to 1 (which ##{ 1 #} already does IIRC, so that's not as crazy
as it may sound).  I don't say that it will not be the case at one point
of time, but that would be a different, unrelated change that has
nothing to do with this issue.

Since accessors make sense for more than just indexing by single
numbers, I would consider it imprudent to make the implementation of
vectors depend on special syntax unnecessarily.

-- 
David Kastrup


_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to