lilypond-devel
[Top][All Lists]
Advanced

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

Re: get_property vs internal_get_property


From: David Kastrup
Subject: Re: get_property vs internal_get_property
Date: Mon, 18 Aug 2014 10:50:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Mike Solomon <address@hidden> writes:

> On Aug 18, 2014, at 9:39 AM, Janek Warchoł <address@hidden> 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



reply via email to

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