lilypond-devel
[Top][All Lists]
Advanced

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

Naming question for get_property, set_property


From: David Kastrup
Subject: Naming question for get_property, set_property
Date: Mon, 10 Feb 2020 23:47:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

So for longterm efficiency reasons I am planning to reimplement the
get_property/set_property macros and underlying data structures that map
to get_property_internal/set_property_internal.  They are currently used
across a number of types in a sort of polymorphism, and for "reasons" I
need to know the type, so the call would become something akin to

get_property (Grob, "color");
or
set_property (Grob, "stencil", SCM_BOOL_F);

Now this is longer than before.  Removing _property is not really an
option since that lands us with std::set getting mapped to
std::set_property_internal (or whatever).

So Set and Get ?  Or set_prop and get_prop ?  Or Set_prop and Get_prop ?

Or, since there are not all that many types to cater for, grob_set,
grob_get, music_set, music_get, event_set, event_get (those obviously
without the extra type argument) and what else I've been missing?

It will look a bit redundant either way with

grob->Get (Grob, "color");
or
grob->grob_set ("stencil", SCM_BOOL_F);

The bulk of the replacement will be done by script, with manual cleanup
afterwards (some property names exist in more than one domain).  People
will still have to look at the source code afterwards without throwing
up, so what is your preference?

-- 
David Kastrup
My replies have a tendency to cause friction.  To help mitigating
damage, feel free to forward problematic posts to me adding a subject
like "timeout 1d" (for a suggested timeout of 1 day) or "offensive".



reply via email to

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