Re: [frogs] Changing subproperties with grob-set-property (working on bug #40)

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


Marc Hohl schrieb:
Neil Puttock schrieb:
[...]

2) create a new exported function ly_grob_set_nested_property_x ()

I favour the latter, since it's cleaner to implement: if you amend
ly:grob-set-property! you'll have to use a hybrid type check, since
the property path could be either a symbol or list.
Ok, I will have a look at the code. I am sure that questions will arise,
because c++ is new for me, but nevertheless ...
Staring at the code, I get a faint impression that it would be more difficult than I expected. But there is a file lily/nested-property.cc. Are there some functions that would do the job or
at least something similar to it?

At the moment, I think I understood the meaning of the arguments to LY_DEFINE:
First comes the c++ name of the function, then the name used in scheme,
then the number of required arguments, the number of optional arguments,
then a zero (?? at least in every function I looked at), then a list of arguments (...)
and the docstring.

So the header of the definition could be

LY_DEFINE (ly_grob_set_nested_property_x, "ly:grob-set-nested-property!",
      3, 0, 0, (SCM grob, SCM symlist, SCM val),
"Set nested property @var{symlist} in grob @var{grob} to value @var{val}.")
{
 Grob *sc = unsmob_grob (grob);

 LY_ASSERT_SMOB (Grob, grob, 1);
 LY_ASSERT_TYPE (ly_is_list, symlist, 2);

But that's more or less a guess...

Marc

---

----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/