Re: `ly:context-property` and empty alist,Re: `ly:context-property` and empty alist

2022-07-10 Thread Werner LEMBERG
> the problem here is not really ly:context-property, but the > C-implementation Context::internal_get_property, which uses SCM_EOL > as default value. [...] Thanks for the explanation! > #(define (context-has-defined? context sym) >(eq? (ly:context-property-where-defined context sym) conte

`ly:context-property` and empty alist

2022-07-10 Thread Werner LEMBERG
The documentation of `ly:context-property` is as follows. -- Function: ly:context-property context sym def Return the value for property SYM in CONTEXT. If DEF is given, and property value is ‘'()’, return DEF. I have a use case where I want to say ``` \set SYM = #'() ``` i.e., I

Re: `ly:context-property` and empty alist

2022-07-10 Thread Jean Abou Samra
> Le 10 juil. 2022 à 13:47, Werner LEMBERG a écrit : > >  > The documentation of `ly:context-property` is as follows. > > -- Function: ly:context-property context sym def > > Return the value for property SYM in CONTEXT. If DEF is given, > and property value is ‘'()’, return DEF.

Re: `ly:context-property` and empty alist

2022-07-10 Thread Valentin Petzel
Hello Werner, the problem here is not really ly:context-property, but the C-implementation Context::internal_get_property, which uses SCM_EOL as default value. So Lilypond’s guile interface cannot know if a NULL is actually set or if the context property is not set. It would be possible to chec

Re: `ly:context-property` and empty alist

2022-07-10 Thread Werner LEMBERG
>> I have a use case where I want to say >> >> ``` >> \set SYM = #'() >> ``` >> >> i.e., I explicitly want to override the default DEF with an empty >> list. How can I do that? > > As a user, if the code is written that way, you have no proper > solution. Yes, that’s a bit sad. (If the property

Re: `ly:context-property` and empty alist

2022-07-10 Thread Jean Abou Samra
Le 10/07/2022 à 14:32, Valentin Petzel a écrit : Hello Werner, the problem here is not really ly:context-property, but the C-implementation Context::internal_get_property, which uses SCM_EOL as default value. So Lilypond’s guile interface cannot know if a NULL is actually set or if the contex