On Sep 7, 2014, at 4:15 PM, e...@ticalc.org wrote: > On 2014/09/07 06:20:59, dak wrote: >> I don't like it. The maximum range of a variable is an arbitrary > value and this >> "loop avoidance" will not do us much good on a 64-bit architecture. > > Thanks for pointing that out. I will make the limits template > parameters and restrict them to the range of a 32-bit int when used in > this method. If someone with more knowledge of the internals can > suggest saner limits, I will gladly use them instead.
I can’t think of a case where the depth of parenthood would go over a few grobs (5-6ish) in normal engraving. Something like 1024 would be more than enough, after which a programming error could be issued. > >> Or, much preferable, we should catch any such cases where the circular > reference >> is established. > > I agree that fixing the root cause is the best thing to do. I am not > yet familiar enough with this stuff to do that, but this backstop is > beneficial. Termination is more user-friendly than endless looping. > People tend to get angry when their time is wasted. > > +1. The only other solution I see is to check when the parental relationship is being created, but this check results in a performance hit. If someone cooked up a speedy algorithm, then I think it would be a good idea to check at relationship-creation time. Cheers, MS > https://codereview.appspot.com/134600043/ > > _______________________________________________ > lilypond-devel mailing list > lilypond-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-devel _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel