Good deal!  I used a callback - patch to be sent in the not-too-distant
future.

~Mike

On 6/2/10 4:26 PM, "Han-Wen Nienhuys" <hanw...@gmail.com> wrote:

> On Wed, Jun 2, 2010 at 8:28 AM, Mike Solomon <mike...@ufl.edu> wrote:
>>    I am toying around with a new spanner, and before it prints, I need to
>> do some calculations on all of its broken_intos_.  I can easily do these
>> calculations in the print function by accessing the broken_into_ of
>> spanner->original (), but then this calculation is done for each time print
>> is called, which is N-1 times too many (where N is the length of
>> broken_into_).  The code works just fine, but it is overkill: is there a way
>> to perform operations on a spanner and its broken_into_'s once before the
>> print function is called?
> 
> Use a property with an attached callback to either hold the
> computation result. The callback/property infrastructure will make
> sure it  happens only once.  What are you trying to calculate?  You
> can also have a look at some of the callbacks that attach to
> 'positioning-done, see for example the vertical alignment spanners.
> 
> Since LilyPond is single-threaded, nothing really happens in parallel.



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to