Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #1857
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | "BartC" <bc@freeuk.com> |
| Newsgroups | comp.programming |
| Subject | Re: Pre And Post Increment Operator Output |
| Date | Fri, 22 Jun 2012 21:35:16 +0100 |
| Organization | A noiseless patient Spider |
| Lines | 1 |
| Message-ID | <js2l17$cd9$1@dont-email.me> (permalink) |
| References | <8404c4f1-a3b7-46b7-ad9c-17de265f9aee@googlegroups.com><js02hp$jsl$1@dont-email.me> <js03uf$sb3$1@dont-email.me><js092m$pov$1@dont-email.me> <lnipek8bri.fsf@nuthaus.mib.org><js1gf5$l7v$1@dont-email.me><0.06d3eacd14619c86d384.20120622143458BST.87ehp7o4fx.fsf@bsb.me.uk><js21jb$963$1@dont-email.me><7MudnTZhnIs6EnnSnZ2dnUVZ_qCdnZ2d@earthlink.com><js27pl$h7c$1@dont-email.me> <0.0b3aeb4b00dfdccbd115.20120622205336BST.87395nnmwv.fsf@bsb.me.uk> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; format=flowed; charset="iso-8859-1"; reply-type=original |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Fri, 22 Jun 2012 20:36:55 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="g02lTOQ/PuOntaKLE4vnTw"; logging-data="12713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Yvz56B1+ZFa+QhrX3KBO1" |
| X-MimeOLE | Produced By Microsoft MimeOLE V14.0.8089.726 |
| In-Reply-To | <0.0b3aeb4b00dfdccbd115.20120622205336BST.87395nnmwv.fsf@bsb.me.uk> |
| X-Antivirus-Status | Clean |
| X-Newsreader | Microsoft Windows Live Mail 14.0.8089.726 |
| Importance | Normal |
| X-Antivirus | avast! (VPS 120622-0, 22/06/2012), Outbound message |
| Cancel-Lock | sha1:tq/JKM7NP4cRezSjTD4a166k+iY= |
| X-Priority | 3 |
| X-MSMail-Priority | Normal |
| Xref | csiph.com comp.programming:1857 |
Show key headers only | View raw
"Ben Bacarisse" <ben.usenet@bsb.me.uk> wrote in message news:0.0b3aeb4b00dfdccbd115.20120622205336BST.87395nnmwv.fsf@bsb.me.uk... > "BartC" <bc@freeuk.com> writes: >> "Patricia Shanahan" <pats@acm.org> wrote in message >>> On 6/22/2012 8:02 AM, BartC wrote: >>>> result of i=(++i)+(++i)+(++i), when i starts at 0 >>> In Java, i does have a specified resulting value. The effect will be the >>> same as i=3*i+6. >> >> So it ends up with i=6, when i starts at zero. The case for '6' is >> improving.. > > The case for 6 in Java is rock-solid. > > <snip> >> I suggested in comp.lang.c that the result of the above ought to be 6, >> in line with the original poster's expectations, (before going on to >> explain why it might not be in C), for which I was castigated and even >> called evil. > > Way to go BartC. Maybe the OP in the original thread had a Java background. Or maybe he just decided the common-sense result was 6, and wanted to know why C didn't agree. But I give up; you win. Clearly if someone sees such an expression, even before they go anywhere near an actual programming language, they have to assume that *expecting* a result such as 94613277, is just as plausible as expecting it to be as 6. (BTW how did Java, a C derivative, end up with well-defined semantics for this kind of expression? And why isn't the result 94613227, but... 6? Why choose 6? Because, after all, you guys keep telling me that i = (++i)+(++i)+(++i) is completely meaningless. Or is it conceivable that 6 does, after all, actually make more sense than 94613277..) Anyway, I'll leave you guys to it. -- Bartc
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar
Re: Pre And Post Increment Operator Output "BartC" <bc@freeuk.com> - 2012-06-22 16:02 +0100
Re: Pre And Post Increment Operator Output Patricia Shanahan <pats@acm.org> - 2012-06-22 08:30 -0700
Re: Pre And Post Increment Operator Output "BartC" <bc@freeuk.com> - 2012-06-22 17:49 +0100
Re: Pre And Post Increment Operator Output Patricia Shanahan <pats@acm.org> - 2012-06-22 10:36 -0700
Re: Pre And Post Increment Operator Output "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-06-23 09:57 +0100
Re: Pre And Post Increment Operator Output Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-22 20:53 +0100
Re: Pre And Post Increment Operator Output "BartC" <bc@freeuk.com> - 2012-06-22 21:35 +0100
Re: Pre And Post Increment Operator Output Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-22 23:19 +0100
Re: Pre And Post Increment Operator Output "BartC" <bc@freeuk.com> - 2012-06-23 01:15 +0100
Re: Pre And Post Increment Operator Output Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-22 17:44 +0100
csiph-web