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


Groups > comp.lang.java.programmer > #15252 > unrolled thread

"Small" Program Challenge.

Started byDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
First post2012-06-13 13:45 -0700
Last post2012-06-20 21:19 -0400
Articles 20 on this page of 88 — 17 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-13 13:45 -0700
    Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-13 13:52 -0700
      Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-13 16:17 -0700
        Re: "Small" Program Challenge. glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-06-14 00:16 +0000
      Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-13 16:19 -0700
        Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-13 16:24 -0700
      Re: "Small" Program Challenge. markspace <-@.> - 2012-06-13 17:40 -0700
    Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-13 21:28 -0400
    Re: "Small" Program Challenge. Roedy Green <see_website@mindprod.com.invalid> - 2012-06-13 20:52 -0700
      Re: "Small" Program Challenge. "Hiram Hunt" <hiramhunt@verizon.net> - 2012-06-14 08:23 -0400
        Re: "Small" Program Challenge. "Hiram Hunt" <hiramhunt@verizon.net> - 2012-06-14 08:30 -0400
      Re: "Small" Program Challenge. Arne Vajhøj <arne@vajhoej.dk> - 2012-06-17 21:17 -0400
    Re: "Small" Program Challenge. Paul Cager <paul.cager@googlemail.com> - 2012-06-14 02:32 -0700
    Re: "Small" Program Challenge. Bent C Dalager <bcd@pvv.ntnu.no> - 2012-06-14 11:29 +0000
    Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-14 12:50 -0700
    Re: "Small" Program Challenge. Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-06-14 15:49 -0500
    Re: "Small" Program Challenge. Gene Wirchenko <genew@ocis.net> - 2012-06-14 14:56 -0700
    Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-14 17:02 -0700
    Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-14 17:09 -0700
    Re: "Small" Program Challenge. Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-06-15 22:13 -0700
      Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-16 12:11 -0700
    Re: "Small" Program Challenge. Wanja Gayk <brixomatic@yahoo.com> - 2012-06-17 15:22 +0200
      Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-17 15:24 -0700
        Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-17 18:25 -0400
          Re: "Small" Program Challenge. Arne Vajhøj <arne@vajhoej.dk> - 2012-06-17 20:31 -0400
            Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-17 20:55 -0400
              Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-17 20:40 -0700
                Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-17 23:43 -0400
                Re: "Small" Program Challenge. Lew <noone@lewscanon.com> - 2012-06-17 21:25 -0700
                  Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 00:45 -0400
                    Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-18 12:47 -0700
                      Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 15:57 -0400
                        Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-18 13:31 -0700
                          Re: "Small" Program Challenge. Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-06-18 16:05 -0500
                            Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-18 14:18 -0700
                              Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 19:50 -0400
                          Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 19:48 -0400
                            Re: "Small" Program Challenge. David Lamb <dalamb@cs.queensu.ca> - 2012-06-19 08:07 -0400
                              Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 15:26 -0400
                  Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-18 09:04 -0700
                    Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 13:09 -0400
                      Re: "Small" Program Challenge. markspace <-@.> - 2012-06-18 11:06 -0700
                        Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 14:46 -0400
                          Re: "Small" Program Challenge. markspace <-@.> - 2012-06-18 13:22 -0700
                            Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 19:51 -0400
                        Re: "Small" Program Challenge. Wanja Gayk <brixomatic@yahoo.com> - 2012-06-20 13:11 +0200
                          Re: "Small" Program Challenge. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-22 12:54 -0700
                            Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-22 18:30 -0400
                              Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-25 12:59 -0700
                                Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-25 16:49 -0400
                    Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-18 12:44 -0700
                      Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 16:01 -0400
                        Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-18 13:36 -0700
                          Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 20:01 -0400
                            Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-18 18:25 -0700
                              Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 22:01 -0400
                              Re: "Small" Program Challenge. Gene Wirchenko <genew@ocis.net> - 2012-06-18 19:04 -0700
                                Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-18 22:12 -0400
                                  Re: "Small" Program Challenge. Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-19 12:36 +0000
                                    Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 15:28 -0400
                                  Re: "Small" Program Challenge. Gene Wirchenko <genew@ocis.net> - 2012-06-19 09:12 -0700
                                    Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 15:30 -0400
                                      Re: "Small" Program Challenge. Gene Wirchenko <genew@ocis.net> - 2012-06-19 15:04 -0700
                                        Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 18:23 -0400
                                          Re: "Small" Program Challenge. Gene Wirchenko <genew@ocis.net> - 2012-06-19 15:32 -0700
                                            Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 19:09 -0400
                                          Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 19:10 -0400
                                      Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-19 17:19 -0700
                                        Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 20:42 -0400
                                          Re: "Small" Program Challenge. Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-06-19 20:01 -0500
                                            Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-19 21:12 -0400
                                              Re: "Small" Program Challenge. Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-06-19 20:32 -0500
                                                Re: "Small" Program Challenge. Lew <noone@lewscanon.com> - 2012-06-19 22:01 -0700
                                                  Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-20 21:15 -0400
                                                Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-20 21:05 -0400
                                                  Re: "Small" Program Challenge. Wanja Gayk <brixomatic@yahoo.com> - 2012-06-23 13:42 +0200
                                                    Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-23 12:12 -0400
                                                      Re: "Small" Program Challenge. Wanja Gayk <brixomatic@yahoo.com> - 2012-06-23 23:10 +0200
                                                        Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-23 17:14 -0400
                                            Re: "Small" Program Challenge. Lew <noone@lewscanon.com> - 2012-06-19 22:15 -0700
                                              Re: "Small" Program Challenge. Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-20 10:34 +0000
                                                Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-20 10:45 -0700
                                                  Re: "Small" Program Challenge. Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-21 08:13 +0000
                                                    Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-21 17:18 -0400
                                                      Re: "Small" Program Challenge. Lew <lewbloch@gmail.com> - 2012-06-21 15:30 -0700
                                                        Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-21 20:28 -0400
                                                Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-20 21:22 -0400
                                              Re: "Small" Program Challenge. "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2012-06-20 21:19 -0400

Page 4 of 5 — ← Prev page 1 2 3 [4] 5  Next page →


#15422

FromGene Wirchenko <genew@ocis.net>
Date2012-06-19 09:12 -0700
Message-ID<4291u795eegvb0j8b09lvqkng3hh13t336@4ax.com>
In reply to#15405
On Mon, 18 Jun 2012 22:12:50 -0400, "javax.swing.JSnarker"
<gharriman@boojum.mit.edu> wrote:

[snip]

>Void main() is not supported by the C specification. However, the quoted 
>section of the JLS clearly states that initialization precedes 
>invocation (which is also just plain common sense).

  1) It is "void", not "Void", and

  2) more importantly, "void main()" is legal C, just not in a hosted
implementation.  Since the usual use of C is under a hosted
implementation, "void main()" is something to avoid in general, but
only in general.

     Why not just read the JLS instead using "common sense" and
baseball gloves?

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#15426

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-19 15:30 -0400
Message-ID<jrqk0m$e2b$3@speranza.aioe.org>
In reply to#15422
On 19/06/2012 12:12 PM, Gene Wirchenko wrote:
> On Mon, 18 Jun 2012 22:12:50 -0400, "javax.swing.JSnarker"
> <gharriman@boojum.mit.edu> wrote:
>
> [snip]
>
>> Void main() is not supported by the C specification. However, the quoted
>> section of the JLS clearly states that initialization precedes
>> invocation (which is also just plain common sense).
>
>    1) It is "void", not "Void", and

Yes, I know, however it was at the start of a sentence and part of 
English prose rather than compilable code.

>    2) more importantly, "void main()" is legal C,

Not according to any of the books I've read, and there have been many.

>       Why not just read the JLS instead using "common sense" and
> baseball gloves?

I read the JLS *as well*. The JLS clearly stated that initialization 
*precedes* invocation. It does not follow it and it certainly does not 
happen *during* it, as some recent posts to this thread seem to have 
suggested.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15428

FromGene Wirchenko <genew@ocis.net>
Date2012-06-19 15:04 -0700
Message-ID<ojt1u7d8oomtd7aaqgl1a433570jmqoqbs@4ax.com>
In reply to#15426
On Tue, 19 Jun 2012 15:30:33 -0400, "javax.swing.JSnarker"
<gharriman@boojum.mit.edu> wrote:

>On 19/06/2012 12:12 PM, Gene Wirchenko wrote:
>> On Mon, 18 Jun 2012 22:12:50 -0400, "javax.swing.JSnarker"
>> <gharriman@boojum.mit.edu> wrote:
>>
>> [snip]
>>
>>> Void main() is not supported by the C specification. However, the quoted
>>> section of the JLS clearly states that initialization precedes
>>> invocation (which is also just plain common sense).
>>
>>    1) It is "void", not "Void", and
>
>Yes, I know, however it was at the start of a sentence and part of 
>English prose rather than compilable code.

     Since it is a code example, English grammar does not apply.

>>    2) more importantly, "void main()" is legal C,
>
>Not according to any of the books I've read, and there have been many.

     What about the C standard?  You have snipped my qualifying
phrase.  "void main()" is valid under a non-hosted implementation.  I
expect that most C programmers are not using it that way, and that is
why your books do not cover it.  The C standard does though.

     You have missed the fine point of the argument I have given. This
leads me to believe you have likely missed it in the Java argument of
this thread.

>>       Why not just read the JLS instead using "common sense" and
>> baseball gloves?
>
>I read the JLS *as well*. The JLS clearly stated that initialization 
>*precedes* invocation. It does not follow it and it certainly does not 
>happen *during* it, as some recent posts to this thread seem to have 
>suggested.

     Why would people argue over something that is clearly stated?
Although Lew is somewhat abrasive, he has established credibility. You
do not.  I know how I would bet.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#15429

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-19 18:23 -0400
Message-ID<jrqu55$8ij$1@speranza.aioe.org>
In reply to#15428
On 19/06/2012 6:04 PM, Gene Wirchenko wrote:
> On Tue, 19 Jun 2012 15:30:33 -0400, "javax.swing.JSnarker"
> <gharriman@boojum.mit.edu> wrote:
>
>> On 19/06/2012 12:12 PM, Gene Wirchenko wrote:
>>> On Mon, 18 Jun 2012 22:12:50 -0400, "javax.swing.JSnarker"
>>> <gharriman@boojum.mit.edu> wrote:
>>>
>>> [snip]
>>>
>>>> Void main() is not supported by the C specification. However, the quoted
>>>> section of the JLS clearly states that initialization precedes
>>>> invocation (which is also just plain common sense).
>>>
>>>     1) It is "void", not "Void", and
>>
>> Yes, I know, however it was at the start of a sentence and part of
>> English prose rather than compilable code.
>
>       Since it is a code example, English grammar does not apply.

"Void main() is not supported by the C specification." is English prose, 
not a code example.

>> Not according to any of the books I've read, and there have been many.
>
>       What about the C standard?

I assume that the books follow the C standard, or at least the vast 
majority of them do. As for the standard itself, for some peculiar 
reason it doesn't seem to be available anywhere by simple point, click, 
download free of charge, unlike the JLS.

>       You have missed the fine point of the argument I have given.

I have done nothing of the sort, or anything wrong at all, and I will 
thank you to stop publicly smearing me by claiming or suggesting 
otherwise in news posts.

>> I read the JLS *as well*. The JLS clearly stated that initialization
>> *precedes* invocation. It does not follow it and it certainly does not
>> happen *during* it, as some recent posts to this thread seem to have
>> suggested.
>
>       Why would people argue over something that is clearly stated?

I do not know why Lew is arguing over something that is clearly stated. 
I have a guess (that he's throwing up a smokescreen rather than admit 
he's wrong) but no proof that it's correct.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15430

FromGene Wirchenko <genew@ocis.net>
Date2012-06-19 15:32 -0700
Message-ID<r8v1u79vs72m6q5qfuekndkqf4qtatvoik@4ax.com>
In reply to#15429
On Tue, 19 Jun 2012 18:23:33 -0400, "javax.swing.JSnarker"
<gharriman@boojum.mit.edu> wrote:

>On 19/06/2012 6:04 PM, Gene Wirchenko wrote:
>> On Tue, 19 Jun 2012 15:30:33 -0400, "javax.swing.JSnarker"
>> <gharriman@boojum.mit.edu> wrote:
>>
>>> On 19/06/2012 12:12 PM, Gene Wirchenko wrote:
>>>> On Mon, 18 Jun 2012 22:12:50 -0400, "javax.swing.JSnarker"
>>>> <gharriman@boojum.mit.edu> wrote:
>>>>
>>>> [snip]
>>>>
>>>>> Void main() is not supported by the C specification. However, the quoted
>>>>> section of the JLS clearly states that initialization precedes
>>>>> invocation (which is also just plain common sense).
>>>>
>>>>     1) It is "void", not "Void", and
>>>
>>> Yes, I know, however it was at the start of a sentence and part of
>>> English prose rather than compilable code.
>>
>>       Since it is a code example, English grammar does not apply.
>
>"Void main() is not supported by the C specification." is English prose, 
>not a code example.

     Oh, but it is.  It is only prohibited in a hosted implementation.

     CLUE: There is a reason why I keep qualifying my statement with
"hosted" or "non-hosted".

>>> Not according to any of the books I've read, and there have been many.
>>
>>       What about the C standard?
>
>I assume that the books follow the C standard, or at least the vast 
>majority of them do. As for the standard itself, for some peculiar 
>reason it doesn't seem to be available anywhere by simple point, click, 
>download free of charge, unlike the JLS.

     I have seen plenty that suggest "void main()" in a hosted
implementation.  It is the first thing that I look for in evaluating
quality.

>>       You have missed the fine point of the argument I have given.
>
>I have done nothing of the sort, or anything wrong at all, and I will 
>thank you to stop publicly smearing me by claiming or suggesting 
>otherwise in news posts.

     You keep missing the distinction that I keep making about hosted
and non-hosted implementations.

     I am not smearing you; I am making a point that you keep ignoring
while claiming to understand.

>>> I read the JLS *as well*. The JLS clearly stated that initialization
>>> *precedes* invocation. It does not follow it and it certainly does not
>>> happen *during* it, as some recent posts to this thread seem to have
>>> suggested.
>>
>>       Why would people argue over something that is clearly stated?
>
>I do not know why Lew is arguing over something that is clearly stated. 
>I have a guess (that he's throwing up a smokescreen rather than admit 
>he's wrong) but no proof that it's correct.

     I think it more likely that it is you who is wrong.  I await your
next smokescreen post.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#15432

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-19 19:09 -0400
Message-ID<jrr0rn$eeg$1@speranza.aioe.org>
In reply to#15430
On 19/06/2012 6:32 PM, Gene Wirchenko wrote:
> <gharriman@boojum.mit.edu> wrote:
>> On 19/06/2012 6:04 PM, Gene Wirchenko wrote:
>>> <gharriman@boojum.mit.edu> wrote:
>>>> On 19/06/2012 12:12 PM, Gene Wirchenko wrote:
>>>>> <gharriman@boojum.mit.edu> wrote:
>>>>>> Void main() is not supported by the C specification. However, the quoted
>>>>>> section of the JLS clearly states that initialization precedes
>>>>>> invocation (which is also just plain common sense).
>>>>>      1) It is "void", not "Void", and
>>>> Yes, I know, however it was at the start of a sentence and part of
>>>> English prose rather than compilable code.
>>>        Since it is a code example, English grammar does not apply.
>> "Void main() is not supported by the C specification." is English prose,
>> not a code example.
>       Oh, but it is.

It is, indeed, English prose; glad you realize that now.

>>>> Not according to any of the books I've read, and there have been many.
>>>        What about the C standard?
>> I assume that the books follow the C standard, or at least the vast
>> majority of them do. As for the standard itself, for some peculiar
>> reason it doesn't seem to be available anywhere by simple point, click,
>> download free of charge, unlike the JLS.
>       I have seen plenty that suggest "void main()" in a hosted
> implementation.  It is the first thing that I look for in evaluating
> quality.

To then reject the ones that suggest it, I hope.

>> I have done nothing of the sort, or anything wrong at all, and I will
>> thank you to stop publicly smearing me by claiming or suggesting
>> otherwise in news posts.
>       You keep missing

I have done nothing of the sort, or anything wrong at all, and I will 
thank you to stop publicly smearing me by claiming or suggesting 
otherwise in news posts.

>> I do not know why Lew is arguing over something that is clearly stated.
>> I have a guess (that he's throwing up a smokescreen rather than admit
>> he's wrong) but no proof that it's correct.
>       I think it more likely that it is you who is wrong.

Then you think wrong. The spec clearly says that initialization precedes 
invocation.

> I await your next smokescreen post.

Then you will be waiting a very long time.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15433

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-19 19:10 -0400
Message-ID<jrr0t2$eeg$2@speranza.aioe.org>
In reply to#15429
On 19/06/2012 7:02 PM, Stefan Ram wrote:
> "javax.swing.JSnarker" <gharriman@boojum.mit.edu> writes:
>> "Void main() is not supported by the C specification." is English prose,
>> not a code example.
>
>    The text with in the quotes misses inner quotes.

What?

[rest deleted as a non sequitur]

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15434

FromLew <lewbloch@gmail.com>
Date2012-06-19 17:19 -0700
Message-ID<4732eeb4-9d34-4765-ba6d-c098f0528038@googlegroups.com>
In reply to#15426
javax.swing.JSnarker wrote:
>  Gene Wirchenko wrote:
> > javax.swing.JSnarker wrote:
> >
> > [snip]
> >
> >> Void main() is not supported by the C specification. However, the quoted
> >> section of the JLS clearly states that initialization precedes
> >> invocation (which is also just plain common sense).
> >
> >    1) It is "void", not "Void", and
> 
> Yes, I know, however it was at the start of a sentence and part of 
> English prose rather than compilable code.
> 
> >    2) more importantly, "void main()" is legal C,
> 
> Not according to any of the books I've read, and there have been many.
> 
> >       Why not just read the JLS instead using "common sense" and
> > baseball gloves?
> 
> I read the JLS *as well*. The JLS clearly stated that initialization 
> *precedes* invocation. It does not follow it and it certainly does not 
> happen *during* it, as some recent posts to this thread seem to have 
> suggested.

It precedes invocation, but not the attempt to invoke.

You are wrong. I have seen in real code where classes were loaded and 
not initialized, causing a bug in code written by the wrong idea you're promoting.

Reality wins.

The JLS clearly states when initialization MUST NOT happen after loading, 
therefore if you read the JLS you will see that the two do not 
happen together automatically, and you will correct your misapprehension.

You are mistaken.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#15436

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-19 20:42 -0400
Message-ID<jrr68t$ohi$1@speranza.aioe.org>
In reply to#15434
On 19/06/2012 8:19 PM, Lew wrote:
> It precedes invocation, but not the attempt to invoke.

That doesn't make sense. "It precedes catching the ball, but not the 
attempt to catch" likewise doesn't make sense.

> You are wrong.

No, I'm not.

> I have seen in real code where classes were loaded and not initialized,

Not relevant here, unless you're claiming you've seen in real code where 
a static method began to be invoked and the class was *still* not 
initialized.

> Reality wins.

And you lose.

The rest of your post is redundant with other parts of it and as such 
has been ignored as asked-and-answered already.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15437

FromLeif Roar Moldskred <leifm@dimnakorr.com>
Date2012-06-19 20:01 -0500
Message-ID<UsydnWLZ1Ih_vXzSnZ2dnUVZ8sKdnZ2d@giganews.com>
In reply to#15436
javax.swing.JSnarker <gharriman@boojum.mit.edu> wrote:
> 
> Not relevant here, unless you're claiming you've seen in real code where 
> a static method began to be invoked and the class was *still* not 
> initialized.

As has been pointed out earlier in the thread, that's exactly what
happens when, with Java 7, you try to start a Java program with a
class that does not contain a valid main method.

-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#15438

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-19 21:12 -0400
Message-ID<jrr81g$rt6$1@speranza.aioe.org>
In reply to#15437
On 19/06/2012 9:01 PM, Leif Roar Moldskred wrote:
> javax.swing.JSnarker <gharriman@boojum.mit.edu> wrote:
>>
>> Not relevant here, unless you're claiming you've seen in real code where
>> a static method began to be invoked and the class was *still* not
>> initialized.
>
> As has been pointed out earlier in the thread, that's exactly what
> happens when, with Java 7, you try to start a Java program with a
> class that does not contain a valid main method.

And as has been pointed out earlier in the thread, that contravenes the 
spec, which says initialization occurs *before* invocation.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15439

FromLeif Roar Moldskred <leifm@dimnakorr.com>
Date2012-06-19 20:32 -0500
Message-ID<2P2dnb8yuIyntXzSnZ2dnUVZ8hGdnZ2d@giganews.com>
In reply to#15438
javax.swing.JSnarker <gharriman@boojum.mit.edu> wrote:
> On 19/06/2012 9:01 PM, Leif Roar Moldskred wrote:
>>
>> As has been pointed out earlier in the thread, that's exactly what
>> happens when, with Java 7, you try to start a Java program with a
>> class that does not contain a valid main method.
> 
> And as has been pointed out earlier in the thread, that contravenes the 
> spec, which says initialization occurs *before* invocation.

I disagree that it contravenes the spec, but regardless it is an
example of "real code where a static method began to be invoked and
the class was still not initialized." Of course, that's assuming that
we consider Java 7 to have "begun to invoke" the missing main method,
but if not, the rest of your argument falls through.

-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#15446

FromLew <noone@lewscanon.com>
Date2012-06-19 22:01 -0700
Message-ID<jrrlfc$bfe$1@news.albasani.net>
In reply to#15439
Leif Roar Moldskred wrote:
> javax.swing.JSnarker wrote:
>> Leif Roar Moldskred wrote:
>>>
>>> As has been pointed out earlier in the thread, that's exactly what
>>> happens when, with Java 7, you try to start a Java program with a
>>> class that does not contain a valid main method.
>>
>> And as has been pointed out earlier in the thread, that contravenes the
>> spec, which says initialization occurs *before* invocation.

No, it doesn't contravene the spec. Initialization *does* occur before 
invocation, but not before the attempt to invoke. As the spec explains.

> I disagree that it contravenes the spec, but regardless it is an
> example of "real code where a static method began to be invoked and
> the class was still not initialized." Of course, that's assuming that
> we consider Java 7 to have "begun to invoke" the missing main method,
> but if not, the rest of your argument falls through.

The same thing happens in Java 5 (and should have happened in 1.2 through 
1.4), if you refer to the 'class' literal of a class before any action that 
triggers intialization, the class will be loaded but not initialized.

As required by the JLS. Since before Java 5. Admittedly (in that Sun admitted 
it) there was a bug in Sun's Java 1.4 whereby reference to the 'class' literal 
did cause class initialization, but they fixed that in Java 5.

These are facts which completely undercut "JSnarker"'s claim. As does the JLS:

<http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.4.2>
"The procedure assumes that the Class object has already been verified and 
prepared, and that the Class object contains state that indicates one of four 
situations:

"- This Class object is verified and prepared but not initialized.
..."

See?

There is a point at which a class has been loaded, verified and prepared, but 
not initialized.

That state can exist at any of the initialization points mentioned in § 
12.4.1, e.g., "immediately before the first occurrence of ... T is a class and 
a static method declared by T is invoked."

Prior to that, the class may have already been loaded but not initialized, 
e.g., by a reference to its 'class' literal or by an invocation of 
'Class#forName()' with the 'intialize' parameter set to 'false'.

As for the process happening upon an attempt to invoke, here's language from 
12.1.1:

"The initial attempt to execute the method main of class Test discovers that 
the class Test is not loaded ..."

Where's your temporal sequence now, O Snarky One? As I have stated and you 
have obstinately rejected repeatedly, the loading (if not yet done) and 
initialization occurs upon the attempt to invoke, i.e., the attempt happens 
first, conceptually.

Read the JLS and understand.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#15475

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-20 21:15 -0400
Message-ID<jrtsjc$6s5$1@speranza.aioe.org>
In reply to#15446
On 20/06/2012 1:01 AM, Lew wrote:
> Leif Roar Moldskred wrote:
>> javax.swing.JSnarker wrote:
>>> Leif Roar Moldskred wrote:
>>>>
>>>> As has been pointed out earlier in the thread, that's exactly what
>>>> happens when, with Java 7, you try to start a Java program with a
>>>> class that does not contain a valid main method.
>>>
>>> And as has been pointed out earlier in the thread, that contravenes the
>>> spec, which says initialization occurs *before* invocation.
>
> No, it doesn't contravene the spec. Initialization *does* occur before
> invocation, but not before the attempt to invoke. As the spec explains.

The spec explains no such thing -- fortunately, because it doesn't make 
sense. You cannot separate "the attempt to invoke" from "invocation". 
The two go hand in hand like the attempt to catch a ball and the 
successful catch. How can they not? Until the first byte of the main 
method's bytecode is executing the attempt may or may not be successful; 
success is defined by the main method's bytecode being entered and 
starting to execute! How *else* could one sensibly define the attempt to 
invoke said bytecode? But then initialization *must* precede the attempt 
to not violate the spec, because otherwise it occurs after at least the 
first byte of the main method begins executing. And by then it's too 
late. The main method will see stuff uninitialized that the spec 
requires it never see uninitialized, and there goes your claim to have a 
conformant implementation. And until that moment, the "attempt to 
invoke" is not guaranteed to succeed and is therefore still an attempt 
and not an invocation by your own peculiar worldview in which you regard 
the two as somehow separate.

> The same thing happens in Java 5 (and should have happened in 1.2
> through 1.4), if you refer to the 'class' literal of a class before any
> action that triggers intialization, the class will be loaded but not
> initialized.

How does loading it right away in such cases accomplish anything useful? 
The class literal might as well evaluate to a memory-cheap stub-object 
that is transparently replaced with the real class object when, and only 
when, something is done with it that goes beyond bandying it about, 
printing it, using its monitor, getting its hashcode, or comparing it 
for equality. And the things that would then trigger actual loading also 
are the ones that trigger initialization. Such a scheme would be *much* 
more in what you previously called the "spirit of lazy initialization".

> These are facts which completely undercut "JSnarker"'s claim.

In a pig's eye.

> As does the JLS:

Only by your twisted and, shall we say "unique", interpretation of it.

> See?
>
> There is a point at which a class has been loaded, verified and
> prepared, but not initialized.

Nothing in that says that that circumstance should be anything but very 
brief, and it's clear that it must exist *at least* very briefly as 
loading obviously must precede initialization.

> As for the process happening upon an attempt to invoke, here's language
> from 12.1.1:
>
> "The initial attempt to execute the method main of class Test discovers
> that the class Test is not loaded ..."
>
> Where's your temporal sequence now, O Snarky One? As I have stated and
> you have obstinately rejected repeatedly, the loading (if not yet done)
> and initialization occurs upon the attempt to invoke, i.e., the attempt
> happens first, conceptually.

What it says is that an attempt is made and fails because the class is 
not both loaded and initialized. It is loaded, if necessary, and 
initialized, and then a fresh attempt is automatically made. THAT 
attempt may then succeed, or fail for other reasons, such as the method 
doesn't exist.

> Read the JLS and understand.

Already did that. Still waiting for you to practice what you preach, thoguh.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15474

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-20 21:05 -0400
Message-ID<jrts0t$55e$1@speranza.aioe.org>
In reply to#15439
On 19/06/2012 9:32 PM, Leif Roar Moldskred wrote:
> javax.swing.JSnarker <gharriman@boojum.mit.edu> wrote:
>> On 19/06/2012 9:01 PM, Leif Roar Moldskred wrote:
>>>
>>> As has been pointed out earlier in the thread, that's exactly what
>>> happens when, with Java 7, you try to start a Java program with a
>>> class that does not contain a valid main method.
>>
>> And as has been pointed out earlier in the thread, that contravenes the
>> spec, which says initialization occurs *before* invocation.
>
> I disagree that it contravenes the spec, but regardless it is an
> example of "real code where a static method began to be invoked and
> the class was still not initialized."

Which would contravene the spec, since the spec clearly says that 
initialization must *precede* invocation.

> Of course, that's assuming that we consider Java 7 to have "begun to
> invoke" the missing main method, but if not, the rest of your argument
> falls through.

Lew considers it to have "begun to invoke" the missing main method, as 
is apparent when he says it attempts to invoke the missing method first. 
So if Lew is correct, then the behavior is out of spec. On the other 
hand, if Lew is wrong, then the argument I made for why if Lew was 
correct the behavior is out of spec falls through, but was moot anyway.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15544

FromWanja Gayk <brixomatic@yahoo.com>
Date2012-06-23 13:42 +0200
Message-ID<MPG.2a4fca138edb1ed698970f@202.177.16.121>
In reply to#15474
In article <jrts0t$55e$1@speranza.aioe.org>, gharriman@boojum.mit.edu 
says...

> Which would contravene the spec, since the spec clearly says that 
> initialization must *precede* invocation.

Between loading and initialization theres still verification, isn't it?

Kind regards,
Wanja

-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#15547

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-23 12:12 -0400
Message-ID<js4psp$59p$1@speranza.aioe.org>
In reply to#15544
On 23/06/2012 7:42 AM, Wanja Gayk wrote:
> In article <jrts0t$55e$1@speranza.aioe.org>, gharriman@boojum.mit.edu
> says...
>
>> Which would contravene the spec, since the spec clearly says that
>> initialization must *precede* invocation.
>
> Between loading and initialization theres still verification, isn't it?

Verification is a part of loading, rather than coming after it.

-- 
public final class JSnarker
extends JComponent
The JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15549

FromWanja Gayk <brixomatic@yahoo.com>
Date2012-06-23 23:10 +0200
Message-ID<MPG.2a504f1e236ecfe5989710@202.177.16.121>
In reply to#15547
In article <js4psp$59p$1@speranza.aioe.org>, gharriman@boojum.mit.edu 
says...
> 
> On 23/06/2012 7:42 AM, Wanja Gayk wrote:
> > In article <jrts0t$55e$1@speranza.aioe.org>, gharriman@boojum.mit.edu
> > says...
> >
> >> Which would contravene the spec, since the spec clearly says that
> >> initialization must *precede* invocation.
> >
> > Between loading and initialization theres still verification, isn't it?
> 
> Verification is a part of loading, rather than coming after it.

I'm curious: How do you want to verify something that you haven't loaded 
yet?

Kind regards,
Wanja

-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#15550

From"javax.swing.JSnarker" <gharriman@boojum.mit.edu>
Date2012-06-23 17:14 -0400
Message-ID<js5bjc$efo$3@speranza.aioe.org>
In reply to#15549
On 23/06/2012 5:10 PM, Wanja Gayk wrote:
> In article <js4psp$59p$1@speranza.aioe.org>, gharriman@boojum.mit.edu
> says...
>>
>> On 23/06/2012 7:42 AM, Wanja Gayk wrote:
>>> In article <jrts0t$55e$1@speranza.aioe.org>, gharriman@boojum.mit.edu
>>> says...
>>>
>>>> Which would contravene the spec, since the spec clearly says that
>>>> initialization must *precede* invocation.
>>>
>>> Between loading and initialization theres still verification, isn't it?
>>
>> Verification is a part of loading, rather than coming after it.
>
> I'm curious: How do you want to verify something that you haven't loaded
> yet?

I don't. Neither do I want a loaded class hanging around unverified 
afterward, though. So the two belong back-to-back. Essentially, 
obtaining the byte code from wherever into main memory is step 1 of 
loading, and verifying it is step 2.

-- 
public final class JSnarker
extends JComponent
A JSnarker is an NNTP-aware component that asynchronously provides 
snarky output when the Ego.needsPuncturing() event is fired in cljp.

[toc] | [prev] | [next] | [standalone]


#15447

FromLew <noone@lewscanon.com>
Date2012-06-19 22:15 -0700
Message-ID<jrrm9n$cpe$1@news.albasani.net>
In reply to#15437
Leif Roar Moldskred wrote:
> javax.swing.JSnarker wrote:
>>
>> Not relevant here, unless you're claiming you've seen in real code where
>> a static method began to be invoked and the class was *still* not
>> initialized.

Here we go. "No true Scotsman". This plus /ad hominem/ attacks.

It is relevant because the argument was over whether initialization always 
occurs together with loading, as you claimed upthread. It does not, as I have 
stated all along. I never made the claim that invocation of a static method 
did not cause (despite following) initialization.

And doesn't your statemtn - "a static method began to be invoked and the class 
was *still* not initialized" - reveal a sequence of "begin to invoke" followed 
by "initialize", just as I've been saying right along?

Do you mean to say you've been arguing against something that you actually 
agree with?

All this time?

If I hadn't been responding via a Web interface I'd've remembered why I 
plonked you a long time ago, snark.

> As has been pointed out earlier in the thread, that's exactly what
> happens when, with Java 7, you try to start a Java program with a
> class that does not contain a valid main method.

As is required by the JLS, and has been since before Java 7.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


Page 4 of 5 — ← Prev page 1 2 3 [4] 5  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web