|
From: | Urs Liska |
Subject: | Re: Discuss signature for new function \annotate |
Date: | Thu, 06 Jun 2013 13:15:16 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
Hi David, thanks for your comments! Am 06.06.2013 12:22, schrieb David Kastrup:
Urs Liska <address@hidden> writes:I'm interested in - general thoughts on the signature design (as I still lack experience with Scheme functions) % Plain signature of the function draft annotate = #(define-void-function (parser location grob type properties annotation) (string? string? list? string?) ) \relative ges, { \key ges \major \clef bass \time 3/4\repeat tremolo 24 ges32-> -\markup { \dynamic "sfz" } \p \< |\annotate Script "critremark" #'(("voice" . "vc1") ("source" . "Ms. 2") ("author" . "Urs Liska") ("date" . "2013-06-06")) "Tenuto added as in Vc. 2"If your first argument is something like Script, you might want to make it of type symbol? instead. I actually have a syntax sanitizing patch in limbo where unquoted words are not accepted as strings. It is not going to make it into 2.18, but I don't promise I won't push it at some later point of time.
What type is the 'grob' argument of \shape?And: with \shape the order of arguments was reversed for syntactical reasons (that I didn't really understand). I would also like to \annotate e.g. individual notes from chords etc. So what would I have to take care of?
That looks very good. How would the values then be accessed? Are they simple variables inside the function? Or does that also create an alist internallyIt is probably worth considering to make properties of type context-mod? (potentially optional), then you can write the argument as \with { voice = "vc1" source = "Ms. 2" author = "Urs Liska" date = "2013-06-06" }
Sure. I'd have to iterate over the alist and ignore all keys I can't handle. But how would that be with a context-mod?Of course, you might get unsets and overrides and reverts slipped in which you would want to weed out again, but list? is also prone to permitting a lot that you don't want to see.
Urs
[Prev in Thread] | Current Thread | [Next in Thread] |