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: Graham Percival
Subject: Re: Corrected comments and a function check_meshing_chords divided in two. (issue 5975054)
Date: Sun, 1 Apr 2012 07:26:03 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Apr 01, 2012 at 06:12:27AM +0000, address@hidden wrote:
> On 2012/04/01 05:00:25, Graham Percival wrote:
> >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))
>   { ... }

ooh, I like that!  I really, really like it!

> However, is a macro nicer ?

Yes, absolutely.

> 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.

I disagree.  If there's a macro like that, used everywhere in the
code base, then as a new contributor I'd be happy assuming that it
does what it claims.  If UP_and_DOWN(d) was broken, then surely
there'd be tons of breakage all over the code.  I consider this a
useful abstraction.

Now, there should probably be a paragraph explaining those two
macros in the CG.  But that's a minor detail.

- Graham



reply via email to

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