Re: for_UP_and_DOWN

2012-04-23 Thread Łukasz Czerwiński
On 22 April 2012 13:16, Han-Wen Nienhuys wrote: > sorry for the delay; I was on holidays > > On Fri, Apr 20, 2012 at 10:45 AM, Łukasz Czerwiński > wrote: > > Could you please say, if there was a reason for using > > do { > > > > } while(flip(&d)); > > > > instead of my macro: if (UP_and_DOWN) >

Re: for_UP_and_DOWN

2012-04-22 Thread Han-Wen Nienhuys
sorry for the delay; I was on holidays On Fri, Apr 20, 2012 at 10:45 AM, Łukasz Czerwiński wrote: > Could you please say, if there was a reason for using > do { > > } while(flip(&d)); > > instead of my macro: if (UP_and_DOWN) Macros make code harder to read for people not into the project, so it

Re: for_UP_and_DOWN

2012-04-20 Thread m...@apollinemike.com
On Apr 17, 2012, at 11:19 PM, Łukasz Czerwiński wrote: > Ok, > > Could we sum up the discussion? > As I understand: for (UP_and_DOWN(d)) >{ >} > > is ok, right? I will wait for two OKs and then make changes and produce and > upload a patch. > > Łukasz > LGTM. Before you tackle this,

Re: for_UP_and_DOWN

2012-04-17 Thread Łukasz Czerwiński
Ok, Could we sum up the discussion? As I understand: for (UP_and_DOWN(d)) { } is ok, right? I will wait for two OKs and then make changes and produce and upload a patch. Łukasz ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.

Re: for_UP_and_DOWN

2012-04-15 Thread Graham Percival
On Sun, Apr 15, 2012 at 05:37:14PM +0200, David Kastrup wrote: > Graham Percival writes: > > I like that solution, but I'm iffy about relying on compiler > > support for elements of languages that are less than 10 years old. > > I was not suggesting we use it. I just pointed out that in future f

Re: for_UP_and_DOWN

2012-04-15 Thread David Kastrup
Graham Percival writes: > On Sun, Apr 15, 2012 at 05:16:07PM +0200, David Kastrup wrote: >> Actually, with option -std=c++0x GCC would accept >> >> for (Direction d : { UP, DOWN }) >> { >>... >> } >> >> and that would be readable enough without having to revert to macros. > > I like that so

Re: for_UP_and_DOWN

2012-04-15 Thread Graham Percival
On Sun, Apr 15, 2012 at 05:16:07PM +0200, David Kastrup wrote: > Actually, with option -std=c++0x GCC would accept > > for (Direction d : { UP, DOWN }) > { >... > } > > and that would be readable enough without having to revert to macros. I like that solution, but I'm iffy about relying on c

Re: for_UP_and_DOWN

2012-04-15 Thread David Kastrup
Łukasz Czerwiński writes: > On 15 April 2012 16:49, David Kastrup wrote: > > Łukasz Czerwiński writes: > > I'd like to write code, that will make Lilypond better or easier > to be > > used > > > Not necessarily the same as "the C++ way". > > > Right :) No iter

Re: for_UP_and_DOWN

2012-04-15 Thread Graham Percival
On Sun, Apr 15, 2012 at 04:49:11PM +0200, David Kastrup wrote: > Łukasz Czerwiński writes: > > > The final suggestion depends on suggestions from all of you. If you > > find a better idea for (UP_and_DOWN(d)), I'll do so. If you find > > easier: for_UP_and_DOWN,

Re: for_UP_and_DOWN

2012-04-15 Thread Łukasz Czerwiński
On 15 April 2012 16:49, David Kastrup wrote: > Łukasz Czerwiński writes: > > I'd like to write code, that will make Lilypond better or easier to be > > used > > Not necessarily the same as "the C++ way". > Right :) No iterators needed here :) > > and it's not my goal to fulfill my ambitions

Re: for_UP_and_DOWN

2012-04-15 Thread David Kastrup
Łukasz Czerwiński writes: > The final suggestion depends on suggestions from all of you. If you > find a better idea for (UP_and_DOWN(d)), I'll do so. If you find > easier: for_UP_and_DOWN, it could be this. I find for_UP_and_DOWN somewhat more consistent, but syntax-awar

Re: for_UP_and_DOWN

2012-04-15 Thread Łukasz Czerwiński
, > > > the first instinct is just to ignore the discussion. > > > > Is this supposed to declare d itself or not? > > ... probably? > > > Lukasz, could we have a nice concise example of exactly what the > final suggestion is? What's the macro? > > - Graham

Re: for_UP_and_DOWN

2012-04-14 Thread Graham Percival
On Sat, Apr 14, 2012 at 06:06:41PM +0200, David Kastrup wrote: > Graham Percival writes: > > >> > for (UP_and_DOWN(d)) > >> > { ... } > >> > for (LEFT_and_RIGHT(d)) > >> > { ... } > >> > > Not yet. I just wanted to clarify what you were talking about, > > since most people don't have the ti

Re: for_UP_and_DOWN

2012-04-14 Thread David Kastrup
Graham Percival writes: > On Sat, Apr 14, 2012 at 04:41:40PM +0200, Łukasz Czerwiński wrote: >> On 14 April 2012 16:25, Graham Percival wrote: >> >> > tldr summary: we use these for direction loops: > > oops, that should be "we propose that we use these direction > loops" > >> > for (UP_and_DOW

Re: for_UP_and_DOWN

2012-04-14 Thread Graham Percival
On Sat, Apr 14, 2012 at 04:41:40PM +0200, Łukasz Czerwiński wrote: > On 14 April 2012 16:25, Graham Percival wrote: > > > tldr summary: we use these for direction loops: oops, that should be "we propose that we use these direction loops" > > for (UP_and_DOWN(d)) > > { ... } > > for (LEFT_and_

Re: for_UP_and_DOWN

2012-04-14 Thread Łukasz Czerwiński
On 14 April 2012 16:25, Graham Percival wrote: > > > If you don't know, what I am talking about, take a quick look at: > > http://codereview.appspot.com/5975054/diff/1/flower/include/direction.hh(lines > > 75-90). > > tldr summary: we use these for direction loops: > > > for (UP_and_DOWN(d)) >

Re: for_UP_and_DOWN

2012-04-14 Thread Graham Percival
On Sat, Apr 14, 2012 at 04:10:50PM +0200, Łukasz Czerwiński wrote: > I've uploaded my patch without for_UP_and_DOWN, but now it's time to talk > about this #define. I'd like to make a second patch that will introduce > that, but there was no consensus. ok, great! > I

for_UP_and_DOWN

2012-04-14 Thread Łukasz Czerwiński
e. 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 > Hi, I've uploaded my patch without for_UP_and_DOWN, but now it's time to t