[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Naming question for get_property, set_property
From: |
David Kastrup |
Subject: |
Re: Naming question for get_property, set_property |
Date: |
Tue, 11 Feb 2020 03:35:25 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> Dan Eble <address@hidden> writes:
>
>> On Feb 10, 2020, at 17:47, David Kastrup <address@hidden> wrote:
>>> It will look a bit redundant either way with
>>>
>>> grob->Get (Grob, "color");
>>> or
>>> grob->grob_set ("stencil", SCM_BOOL_F);
>>
>> "Yuck" either way. Removing "property" to shorten the name is not a
>> good course of action.
>>
>> My brainstorming without knowing your reasons does not seem likely to
>> help, but what the hey ...
>>
>> grob->set<Grob_property> ("stencil", SCM_BOOL_F);
>>
>> grob->set (Grob_property ("stencil"), SCM_BOOL_F);
>>
>> grob->properties["stencil"] = SCM_BOOL_F; // Too much to ask?
>
> Don't work. It has to be a macro, and it has to know the type (so it
> cannot figure it out by overloaded or something).
Well...
property_set (grob, "stencil", SCM_BOOL_F);
and
property_get (grob, "color")
In that manner, the macro gets enough of a hold on the type of the
pointer to make this work. I'll not rule out that one can shimmy enough
of type madness around this to make
property (grob, "stencil") = SCM_BOOL_F;
work but I think that the payoff in relation for the complexity would
not likely be worth it.
--
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".
Re: Naming question for get_property, set_property, Han-Wen Nienhuys, 2020/02/11