[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme pattern for retrieving data in objects
From: |
Dan Eble |
Subject: |
Re: Scheme pattern for retrieving data in objects |
Date: |
Sat, 2 Apr 2022 09:05:00 -0400 |
> On Apr 2, 2022, at 07:38, Han-Wen Nienhuys <hanwenn@gmail.com> wrote:
>
> On Fri, Apr 1, 2022 at 6:43 PM Jean Abou Samra <jean@abou-samra.fr
> <mailto:jean@abou-samra.fr>> wrote:
...
>> (fetch left-bound-info assoc-ref (common-Y X padding attach-dir)
I'm not enthusiastic about multiple variable declarations in one line or
variable declarations that don't even look like declarations.
> Over the years, I've become extremely wary of syntactic sugar: it adds
> an extra barrier to usage/development because everyone not only has to
> learn Scheme, they also have to learn the (lilypond specific) idioms
> involved.
+1. I can imagine frustration after imitating some working code that calls
`ly:grob-property` and being asked in review to use `fetch` instead because it
is better.
If the basic syntax is too verbose, could it be revised rather than added to?
(ly:get grob 'X-offset)
(ly:get grob 'left-bound-info 'padding)
(ly:get context 'alterationGlyphs 1/2)
—
Dan