lilypond-devel
[Top][All Lists]
Advanced

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

Re: Corrected comments and a function check_meshing_chords divided in tw


From: k-ohara5a5a
Subject: Re: Corrected comments and a function check_meshing_chords divided in two. (issue 5975054)
Date: Sun, 01 Apr 2012 06:12:27 +0000

On 2012/04/01 05:00:25, Graham Percival wrote:
Ouch.  I don't find that for loop to be particularly easy to
understand;

No-one has found a clearer way to write this loop in C++.  The best we
can do is choose a consistent idiom that we can learn to recognize.  Any
of the suggested for()-forms hare helpful, so that the so the thing we
recognize is at the top of the loop rather than at the end of a
do..while().

it would be much nicer if there was a macro for this.

It is better to define macros for just the part inside the for(...) .
Then we can write, and auto-indenters can indent,

for (UP_and_DOWN(d))
  { ... }
for (LEFT_and_RIGHT(d))
  { ... }

However, is a macro nicer ?
The first time every new contributor sees this loop form, she has to
take the time to understand it.  The macro adds two steps to initial
understanding: realizing that this must be a macro, and then searching
for the macro definition.

http://codereview.appspot.com/5975054/



reply via email to

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