Path: csiph.com!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Wojtek Newsgroups: comp.lang.java.programmer Subject: Re: Assigning void Date: Sun, 21 Oct 2012 20:20:39 -0700 Organization: A noiseless patient Spider Lines: 38 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="3618768098eb76704679e61fed19aa73"; logging-data="12627"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++xGxfJsdQqwgXtqO9WtG2uq4Wgl7OiaQ=" X-Newsreader: MesNews/1.08.03.00-gb Cancel-Lock: sha1:6hKmqjf4D/uKYsbP3K3P065MbLw= Xref: csiph.com comp.lang.java.programmer:19467 Eric Sosman wrote : > On 10/21/2012 5:52 PM, Wojtek wrote: >> Sven Köhler wrote : >>> Am 13.10.2012 07:54, schrieb Wojtek: >>>> but I want to do: >>>> >>>> (server.getConnectionType() == ConnectionType.ACTIVE) ? >>>> ftp.enterLocalActiveMode() : ftp.enterLocalPassiveMode(); >>> >>> That's not correct Java syntax. Live with it. >> >> So you just posted your first message to this group and this is how you >> want to represent yourself? >> >> Of course it is not valid syntax, I was just trying to start a >> discussion about its possible merits. > > Merits: "If you want Lisp, you know where to find it." > > Seriously, the fact that C permits the ?: operator with void > operands is an historical accident, a holdover from before the days > when `void' came to C. Java lacks C's historical baggage, so there's > little reason to carry it. (Java slavishly perpetuates a few of C's > other infelicities, but this one isn't among them.) The funny thing is that I had not ever used a "void" assignment in C. I was just coding along and I thought that using the ?: operator would be a "neat" thing. Then the compiler complained so I changed it to an if/else statement. But then I started to wonder, so I posted here. Call it idle curiosity... -- Wojtek :-)