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/
_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel