[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default accidental style with timing off
From: |
Fr. Samuel Springuel |
Subject: |
Re: Default accidental style with timing off |
Date: |
Thu, 23 Apr 2020 10:37:15 -0400 |
> On 22 Apr, 2020, at 6:09 PM, Aaron Hill <address@hidden> wrote:
>
> A pattern I could recommend is defining a named procedure as opposed to using
> a lambda with \applyContext:
>
> %%%%
> foo = #(define-music-function () ()
> (define (proc context)
> (do-something-here))
> #{ \applyContext #proc #})
> %%%%
>
> This keeps potentially complex S-expressions outside LilyPond syntax, which
> should improve readability.
Thanks, that does look much nicer.
> Apart from that, I would suggest simplifying your variable names. There is
> no need to call something "mything" when "thing" would suffice. Remember
> that bindings have scope; and local bindings trump. You only need unique
> names if you must have access to both variables.
>
> That said, I would prefer "my-thing" over "mything". You have to be careful
> with smooshing words together lest they read poorly. "curnum" is not ideal
> as it looks like it could be a word in Latin. "currnum" is slightly better,
> but "curr-num" would be the preference if abbreviation is required.
>
> Mind you, I would sidestep all that by calling it "bar-number":
>
> ;;;;
> (let* ((score (ly:context-find context 'Score))
> (bar-number (ly:context-property score 'internalBarNumber)))
> (ly:context-set-property! score 'internalBarNumber (1+ bar-number)))
> ;;;;
>
Good point. I have to admit that I wasn’t paying much attention to the
variable names. As I was combining things from various sources I just ported
over the existing naming conventions without really thinking about how
unreadable they actually were. Cleaning up the variable names, along with the
above change make this much easier to read and like I might have a chance of
understanding scheme more generally.
✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036
PAX ☧ ΧΡΙΣΤΟΣ