From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28571 invoked by alias); 4 Jan 2003 19:58:04 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 28564 invoked from network); 4 Jan 2003 19:58:04 -0000 Received: from unknown (HELO smtp.web.de) (217.72.192.180) by 209.249.29.67 with SMTP; 4 Jan 2003 19:58:04 -0000 Received: from [80.130.179.120] (helo=ws1.tarantula.dnsalias.org) by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18UuQZ-0002f2-00 for gcc@gcc.gnu.org; Sat, 04 Jan 2003 20:57:52 +0100 Date: Sat, 04 Jan 2003 19:59:00 -0000 From: Tolga Dalman To: gcc@gcc.gnu.org Subject: Re: c++ "with" keyword Message-Id: <20030104202819.7c390f19.ates100@web.de> In-Reply-To: <20030104191316.D3B26F28C4@nile.gnat.com> References: <20030104191316.D3B26F28C4@nile.gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00161.txt.bz2 On Sat, 4 Jan 2003 14:13:16 -0500 (EST) dewar@gnat.com (Robert Dewar) wrote: > > ... and potentially two new variables in your code and binary. > > what i wanted to have: > > > > > > { > > #define y long_descriptive_expression_I_dont_like_repeating; > > #define z long_descriptive_expression_I_dont_like_repeating; > > > > z.memberA = z.memberB; > > z.memberB = y.memberA; > > #undef z > > #undef y > > } > > > > but this is just ugly. > > Saying something is ugly is not an argument. It is the absence of a useful > argument. What are you suggesting we do, take a vote to find out which > form more people find ugly? > > (hint: you will probably lose, most C++ programmers will be quite familiar > with the construct above, but will find the proposed WITH unfamiliar and > thus ugly). > > As for two new variables. One would hope not, a stupid compiler might do > that, but then a stupid compiler might generate junk copies to implement > WITH. You really can't base arguments on fantasies about what stupid > compilers might or might not do. > > In short, you have given no technical arguments to prefer your new form > over the familiar existing technique. using the method you proposed will possibly degrade the code, wheras using macros (and "with" should be implemented into the cpp) has never any runtime penalties. btw, being ugly or not is not the question here (as you said, we could argue about), but rather having a clean programming style with an appropriate language. i do regard using macro definitions within "normal" code as blasphemical as using "goto" now and then... Tolga Dalman.