lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Naming RFC: Properties, property sets, presets


From: Urs Liska
Subject: Re: Naming RFC: Properties, property sets, presets
Date: Tue, 14 Jul 2020 09:15:09 +0200
User-agent: Evolution 3.36.3-1

Hi Elaine,

Am Montag, den 13.07.2020, 15:31 -0700 schrieb Flaming Hakama by
Elaine:
> 
> Yes, I did understand it to be more complex than my MWE.
> 
> But the two things I wanted to validate are that
> 
> * The preset is something you pass as part of a function invocation
>      \myFunction \with  { preset = style-two }
> 
> * The preset resolves to a set of property/value pairs.

Yes, it does.

> 
> Yes, I can see that since the property set has defaults, using
> "default" here would be inappropriate.  Also, since they are only
> used in the context of a call to \myFunction, they are not really
> acting like defaults.
> 
> I'm not sure how much this concept is tied to appearance, but a set
> of styling properties is generally called a style sheet, like in CSS.
> 
> In fact, the "default"-like character of this is really more similar
> to cascading style sheets.

The inheritance model is in fact borrowed from CSS.
But while probably 90% of usage will be about appearance the concept
itself is completely not tied to that, so I really don't want to imply
anything like that in the naming. Although I was pleasantly surprised
about "theme".

Property sets might as well define which statistical data from a
compilation to log, or how to construct output names, whether to
include git status info in the file's metadata or filename, whether to
base your composing algorithm on the weather forecast or stock market
data - or actually anything you like.

Therefore I won't follow your suggestion here. Right now I'm pondering
property subsets and property configurations.

BestUrs

> 
> 
> So, 
> 
> \definePropertySet my-function.appearance
> #`((thickness ,number? 1)
>    (color ,color? ,red)
>    (label ,markup? "")
>    (extra-width ,number-pair? (0 . 0))
>    (Y-position ,integer? 0))
> 
> myFunction =
> #(with-property-set define-music-function (mus)(ly:music?)
>   '(my-function appearance)
>   #{
>     \once \override NoteHead.color = #(property 'color)
>     #mus
>   #})
> 
> \defineStylesheet \with {
>     parent = default
>     color = #magenta
> } my-function.appearance style-two
> {
>     \myFunction \with { 
>         stylesheet = style-two 
>     } c'
> }
> 
> If you wanted to reserve "stylesheet" for something more complete,
> another other word in use for interchangeable style configurations is
> "theme"
> 
> 
> \defineTheme \with {
>     parent = default
>     color = #magenta
> } my-function.appearance style-two
> {
>     \myFunction \with { 
>         theme = style-two 
>     } c'
> }
> 
> 
> HTH,
> 
> Elaine Alt
> 415 . 341 .4954                                           "Confusion
> is highly underrated"
> elaine@flaminghakama.com
> Producer ~ Composer ~ Instrumentalist ~ Educator
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=-=-=-=-=-=- 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]