Status: New
Owner: [email protected]
Labels: Type-Enhancement Bounty

New issue 2072 by [email protected]: Add proper complex variables to Lilypond
http://code.google.com/p/lilypond/issues/detail?id=2072

A frequent complaint on the mailing list is that Lilypond does not permit identifiers with numbers in them so that
violin1 = { ... }
violin2 = { ... }
would be possible.  As a somewhat ugly workaround, one can define
"violin1" = { ... }
and use
$violin1

However, apart from the asymmetry, using Scheme identifiers is a solution rather on the ugly side, and the whole construct is not Lilypondish. 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.

makeVector would be 1-based (more natural for people), the corresponding Scheme vector 0-based (more natural for Scheme).

Like make-procedure-with-setter, the mechanism would easily apply to other forms of hashes, accessors, whatever.

This is marked as "Bounty" not because I would be willing to pay a bounty, but because I have not started on this project yet other than some initial brainstorming, I have no compelling need for it other than that it is pretty and challenging, and I am reasonably sure that I could deliver good, concise and elegant code and documentation.

For the basic problem people ask for, "identifier with numbers", this is obviously total overkill. It would, however, most likely be sufficient for satisfying those people requesting the much more confined functionality, and fit nicely with Lilypond while extending its power and expressivity.

I would do the basic functionality for the Lilypond equivalent of Scheme's procedure-with-setter, corresponding documentation and a sample implementation of makeVector once an amount of €300 is pledged.

If there are no objections raised, I'll post a pointer to this issue to the user list on Monday evening.

_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to