Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9042

Re: A freshman's question

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Thu, 20 Oct 2011 12:22:51 -0500
Date Thu, 20 Oct 2011 18:22:56 +0100
From Patricia Shanahan <pats@acm.org>
User-Agent Thunderbird 1.5.0.2 (Windows/20060308)
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: A freshman's question
References <3242b80f-ee51-45f0-9e12-231482f61a97@r2g2000prh.googlegroups.com> <37KdnWZAYfIR1QPTnZ2dnUVZ_vWdnZ2d@earthlink.com> <j7pbaa$92n$1@dont-email.me> <r7l0a7tnf16mukam36n816b6t4jed0p34g@4ax.com>
In-Reply-To <r7l0a7tnf16mukam36n816b6t4jed0p34g@4ax.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <BY2dne2NirN2xT3TnZ2dnUVZ_h6dnZ2d@earthlink.com> (permalink)
Lines 27
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 83.244.254.182
X-Trace sv3-UBhkKYR1EjBjueQ/d4EiiV4Qpt7CEXfo7Vnt3IknQRW2KOV6rGA/TZS6Hh3fShhDAjHfh0dzHqN3RxY!HxFOUxd5rAom331ornXAnPFJQ3wSii/ay3zhoOR0gzQPD0CKh+egWPNsYHYvH/wFVl+MG/zhnqac!hUnFLteUpedj3Sj/fcJ1Z6U673bIrk0JH0oPgdIshKt49e0=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2424
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9042

Show key headers only | View raw


Gene Wirchenko wrote:
> On Thu, 20 Oct 2011 07:30:31 -0700, Travers Naran <tnaran@gmail.com>
> wrote:
> 
> [snip]
> 
>> This is off topic, but I just recently learned that in C++, the result 
>> of i=i++ is officially undefined.  It's interesting a question related 
>> to what I learned comes up again in a completely different forum.
> 
>      That comes from C.  I have a question for anyone thinking it
> valid Java.  What is it supposed to do of use?  (If nothing, why even
> use it?)  I suspect the whole thing got started by someone not
> understanding that ++ causes an assignment to occur.

i = i++; is definitely valid Java, and actual compiler behavior matches
the results the JLS requires for it. Preventing it, but allowing any use 
of the i++ result would require some messy rules.

That does not mean it is a good idea.

In early C code, there was a tendency to try to stuff as much as
possible into a single expression. I don't know the causes - I suspect
some combination of macros and trying to avoid fetching a recently
calculated result from memory. Neither should be a concern in Java.

Patricia

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-18 20:08 -0700
  Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 04:48 +0100
    Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 00:54 -0700
      Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 09:20 +0100
        Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 03:38 -0700
          Re: A freshman's question Lars Enderin <lars.enderin@telia.com> - 2011-10-19 17:48 +0200
            Re: A freshman's question Tim Slattery <Slattery_T@bls.gov> - 2011-10-19 12:24 -0400
              Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:55 -0700
            Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:50 -0700
          Re: A freshman's question Lew <lewbloch@gmail.com> - 2011-10-19 09:58 -0700
            Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 18:47 +0100
            Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:48 -0700
        Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 03:49 -0700
          Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 18:58 +0100
            Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 02:13 -0700
      Re: A freshman's question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-10-19 06:05 -0300
        Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 03:38 -0700
    Re: A freshman's question Travers Naran <tnaran@gmail.com> - 2011-10-20 07:30 -0700
      Re: A freshman's question Gene Wirchenko <genew@ocis.net> - 2011-10-20 10:08 -0700
        Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-20 18:22 +0100
        Re: A freshman's question Lew <lewbloch@gmail.com> - 2011-10-20 13:59 -0700
        Re: A freshman's question Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-10-20 17:38 -0500
  Re: A freshman's question Roedy Green <see_website@mindprod.com.invalid> - 2011-10-19 23:56 -0700
    Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:55 -0700

csiph-web