Re: [frogs] Changing subproperties with grob-set-property (working on bug #40) |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: Marc Hohl <marc@xxxxxxxxxx>
- Subject: Re: [frogs] Changing subproperties with grob-set-property (working on bug #40)
- From: Neil Puttock <n.puttock@xxxxxxxxx>
- Date: Sun, 1 Nov 2009 21:11:36 +0000
- Cc: frogs@xxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5bmLYacGuDlIR1pfENfVQ9B0tW7PRnwP/SME52yFpWg=; b=TzqI8TkKpON3N81nkMFPxGuki1PXi7ebLu+CLRovRpF6TQd/iUHf/sF7cU1+SVwXH6 U7Gg9sXDseJD3inIjw0C/XBCcC0VCMTtNw6hMDYv+lRyPVIyKjIjzxizIhiNbq8mBmN0 94KN5GQrCAv4klJnakHLA1U1sNscqzRl/nnik=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=iI+4Je+aOHHgLo2FaqivCLSuOpoZjNIkT8kPCmpCGrlMkJCN0UPi/C4U63rg2xmycc ShZRP3UexKr7S4/tVEP9ctmpcmbmqMSPFElteEJzn/DIwJH8YpLSJ4OYx38/P7WI0Wr0 8uLnjkZKryZPh7crW6mdo8wyhwWZVnAYQEmPM=
2009/11/1 Marc Hohl <marc@xxxxxxxxxx>:
> 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?
There's only one function in the file which will set a nested
property. If you're still unsure, have a look at
new-dynamic-engraver.cc, which uses this function to set
'bound-details.
>
> 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.
You're on the right track. :)
The third number option sets a `rest' argument (see ly_format () for
an example).
> 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...
Looks OK, though it's preferable to use ly_cheap_is_list for
typechecking symlist, since has a lower overhead.
Regards,
Neil
---
----
Join the Frogs!