Mike Solomon <[email protected]> writes:

> On Aug 18, 2014, at 9:39 AM, Janek Warchoł <[email protected]> wrote:
>
>> Hi,
>> 
>> it's time to ask a n00b question and get the elephant (that was
>> bothering me for a couple years) out of the room: why do we have - and
>> use! - both get_property and internal_get_property?  We ought to use
>> get_property everywhere, right?
>> 
> ...
>> 
>> We are also converting property names from strings to symbols
>> everywhere - for example
>> 
>> SCM meta = info.grob ()->internal_get_property (ly_symbol2scm ("meta"));
>> 
>> What's the reason for that?  And shouldn't we write all the C++ code
>> so that it will automatically do the conversion, like get_property
>> does?
>> 
>
> Entirely reasonable and good idea!

If you take a look at the macro definition of ly_symbol2scm (which in
turn is used in the macro definition of get_property), you'll find that
it does per-invocation magic using __builtin_constant_p and memoization
that cannot be done using C++.

-- 
David Kastrup

_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to