From: Charles Hixson Date: 2002-07-24T07:19:15+09:00 Subject: Re: Syntax "surprise" David Douthitt wrote: > To me, that is not an idiom; this is an idiom: > > foo("This is a really long string. in fact it is so long \ > that it requires two lines....") > > To me, that makes much more sense. > > David Douthitt > CUNA & Affiliates > UNIX Systems Administrator > ddouthitt@cuna.coop > (608) 231-4922 > > >>> pbrannan@atdesk.com 7/23/02 3:09PM >>> > On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote: > > - compile time string concatenation, "hello" "world" => "helloworld" > > > > I know that some other popular languages like to do that, > > but I think it would be better to leave it as two arguments. > > After all, someone wrote those two literals separately on purpose. > > The following is a common idiom: > > foo("this is a really long string. in fact, it is so long " \ > "that I have to wrap onto multiple lines.") > > Paul > > I find that aligning code via white-space makes it more intelligible. I don't really care whether one says: foo("this is a really long string. in fact, it is so long \ that I have to wrap onto multiple lines.") or foo("this is a really long string. in fact, it is so long that I have to wrap onto multiple lines.") I dislike the second half of the string starting at the beginning of the line. And I don't really care whether one says: foo("this is a really long string. in fact, it is so long \n" "that I have to wrap onto multiple lines.") or foo("this is a really long string. in fact, it is so long \n" + " that I have to wrap onto multiple lines.") They both preserve indentation. -- -- Charles Hixson Gnu software that is free, The best is yet to be.