lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checks for recursive element behavior (issue 6943072)


From: dak
Subject: Re: Checks for recursive element behavior (issue 6943072)
Date: Sat, 22 Dec 2012 08:46:21 +0000

On 2012/12/22 08:29:59, mike7 wrote:
Where in the new code are things being allocated and thrown away
temporarily on
the heap?

What do you think extract_grob_set does?

If there is a more efficient way to implement this patch, let me know.
 It
seems, though, that the only way to prevent grobs being elements of
other grobs
is to prevent grobs from being added to elements lists à la this
patch.

That is rubbish.  We can't add checks for any hypothetical programming
error that can't come about as user error.  Here we have one situation,
namely axis groups, where there is a possibility of user error.  So I
proposed setting a context property when having an axis group engraver.

You keep ignoring that proposal as if I never said anything.  It is
simple, efficient, and addresses the problem we see here.

If you think that adding something to an existing set twice is a
fundamental problem, you can easily enough create a hashtable for each
set and check before adding to it that the element is not a member of
this set.

In this particular case, however, the problem is adding an axis group to
an axis group.  _Any_ old axis group to _any_ old axis group.  The check
for that is trivial: in the code adding a grob to an axis group, check
that what you add is not an axis group (assuming that axis groups are
top-level containers).

https://codereview.appspot.com/6943072/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]