[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: referencing hash key with music symbol
From: |
Jeffery Shivers |
Subject: |
Re: referencing hash key with music symbol |
Date: |
Sat, 9 Jul 2016 13:14:21 -0400 |
David, thanks for your response.
> #(define mytable (make-hash-table))
> >
> > #(hash-set! mytable 'Slur slurDashed)
> >
> >
> > \score {
> >
> > \new Staff {
> >
> > #(let ((func (hash-ref mytable 'Slur)))
> >
> > #{
> >
> > #func f'( g')
> >
> > #})
> >
> > }
> >
> > }
> Are you sure this works?
I have no idea what you're expecting, but yes. Entirely.
> And when LilyPond's opinion conflicts with that, your opinion
> does not carry the day when you want LilyPond to act on it.
Preach.
"argument that the symbol satisfies" is gibberish
Not sure if this was a comment more on programming semantics or actual
sense; in either case, that's unfair. Regardless of what \criticalRemark
fully does, it takes some number of arguments: the one of them that 'Slur
satisfies in the context of the example I provided (regardless of whatever
else could be happening with the function) is a `symbol-list-or-music?`
predicate.
Maybe 4:00am should be my new cutoff time for asking for help.. The
following snippet (which I admit could have been provided initially - and
that would have saved us all this pointless conversation) does work, and so
tells me the question asked here did not need to be asked in the first
place.
#(define mytable (make-hash-table))
#(hash-set! mytable 'Slur slurDashed)
foo =
#(define-music-function (item mus)
(symbol? ly:music?)
(let ((func (hash-ref mytable item)))
#{ #func #mus #}))
\score {
\new Staff {
\foo Slur a'( g')
}
}
I strongly suggest to use the openLilyLib option handling infrastructure
> where it would look something like
> \registerOption scholarly.editorial-functions.additions #'()
> \setOption scholarly.editorial-functions.addition.slur #some-function
Urs, this group doesn't necessarily know the mechanics of the above, so it
would not have been sensible to utilize it in the question.
Jeffery
On Sat, Jul 9, 2016 at 7:08 AM, Urs Liska <address@hidden> wrote:
> Am 09.07.2016 um 10:37 schrieb Jeffery Shivers:
> > #(define mytable (make-hash-table))
> >
> > #(hash-set! mytable 'Slur slurDashed)
> >
>
> Just a thought thrown in (as said I'm basically not available until
> Monday evening/Tuesday):
> I strongly suggest to use the openLilyLib option handling infrastructure
> where it would look something like
>
> \registerOption scholarly.editorial-functions.additions #'()
> \setOption scholarly.editorial-functions.addition.slur #some-function
>
> Don't know if that helps with your problem but please consider using the
> existing infrastructure.
>
> Urs
>
> --
> Urs Liska
> www.openlilylib.org
>
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-devel
>