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


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

Re: JLS 3/e -- Lots Of Errors

Started byLew <noone@lewscanon.com>
First post2011-02-05 09:36 -0500
Last post2011-02-07 14:50 +1300
Articles 9 — 4 participants

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: JLS 3/e -- Lots Of Errors Lew <noone@lewscanon.com> - 2011-02-05 09:36 -0500
    Re: JLS 3/e -- Lots Of Errors Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 21:29 -0500
      Re: JLS 3/e -- Lots Of Errors Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 22:00 -0500
        Re: JLS 3/e -- Lots Of Errors Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-08 09:20 +1300
      Re: JLS 3/e -- Lots Of Errors Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:45 +1300
    Re: JLS 3/e -- Lots Of Errors Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-02-06 08:48 -0400
      Re: JLS 3/e -- Lots Of Errors Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 12:31 +1300
        Re: JLS 3/e -- Lots Of Errors Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 20:44 -0500
          Re: JLS 3/e -- Lots Of Errors Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 14:50 +1300

#25572 — Re: JLS 3/e -- Lots Of Errors

FromLew <noone@lewscanon.com>
Date2011-02-05 09:36 -0500
SubjectRe: JLS 3/e -- Lots Of Errors
Message-ID<iijn9l$ccs$2@news.albasani.net>
Lawrence D'Oliveiro wrote:
> * Section 4.5.1.1, page 55:
>
>       T<= ? extends T
>       T<= ? super T
>
> One of these is the wrong way round.

Nope.  Both are true.

-- 
Lew
Ceci n'est pas une fenêtre.
.___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|

[toc] | [next] | [standalone]


#25667

FromJoshua Cranmer <Pidgeot18@verizon.invalid>
Date2011-02-06 21:29 -0500
Message-ID<iinle7$3hi$1@news.eternal-september.org>
In reply to#25572
On 02/06/2011 08:50 PM, Lawrence D'Oliveiro wrote:
> In message<iiniqn$q4v$2@news.eternal-september.org>, Joshua Cranmer wrote:
>
>> On 02/06/2011 06:31 PM, Lawrence D'Oliveiro wrote:
>>
>>> Is a type that “extends” T a subclass or a superclass of T?
>>
>> Neither. Types are not subclasses or superclasses of other things.
>
> What does “<=” mean, again?

In which context? You seem to be striving very hard to explain to us why 
the JLS is a bad spec by trying to test our knowledge on trivia.

If I may use your precious C++ spec as an example, then, please tell me 
what the official output of this code should be:

#include <cstdint>
#include <iostream>

using namespace std;

int main() {
   union {
     int32_t a;
     uint32_t b;
   } obj;

   std::cout << &obj.a == &obj.b << std::endl;
   return 0;
}

The answer may surprise you.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

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


#26005

FromJoshua Cranmer <Pidgeot18@verizon.invalid>
Date2011-02-06 22:00 -0500
Message-ID<iinn8h$7vs$2@news.eternal-september.org>
In reply to#25667
On 02/06/2011 09:45 PM, Lawrence D'Oliveiro wrote:
> In message<iinle7$3hi$1@news.eternal-september.org>, Joshua Cranmer wrote:
>
>> On 02/06/2011 08:50 PM, Lawrence D'Oliveiro wrote:
>>> In message<iiniqn$q4v$2@news.eternal-september.org>, Joshua Cranmer
>>> wrote:
>>>
>>>> On 02/06/2011 06:31 PM, Lawrence D'Oliveiro wrote:
>>>>
>>>>> Is a type that “extends” T a subclass or a superclass of T?
>>>>
>>>> Neither. Types are not subclasses or superclasses of other things.
>>>
>>> What does “<=” mean, again?
>>
>> In which context?
>
> In the context of the language specification we happen to be discussing.

Where it's used a few different times in different contexts. As I said, 
what is the context, i.e., what is the exact, full clause that it is 
being used in.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

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


#26093

FromLawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
Date2011-02-08 09:20 +1300
Message-ID<iipk60$d4o$6@lust.ihug.co.nz>
In reply to#26005
In message <iinn8h$7vs$2@news.eternal-september.org>, Joshua Cranmer wrote:

> On 02/06/2011 09:45 PM, Lawrence D'Oliveiro wrote:
>
>> In message<iinle7$3hi$1@news.eternal-september.org>, Joshua Cranmer
>> wrote:
>>
>>> On 02/06/2011 08:50 PM, Lawrence D'Oliveiro wrote:
>>>> In message<iiniqn$q4v$2@news.eternal-september.org>, Joshua Cranmer
>>>> wrote:
>>>>
>>>>> On 02/06/2011 06:31 PM, Lawrence D'Oliveiro wrote:
>>>>>
>>>>>> Is a type that “extends” T a subclass or a superclass of T?
>>>>>
>>>>> Neither. Types are not subclasses or superclasses of other things.
>>>>
>>>> What does “<=” mean, again?
>>>
>>> In which context?
>>
>> In the context of the language specification we happen to be discussing.
> 
> Where it's used a few different times in different contexts. As I said,
> what is the context, i.e., what is the exact, full clause that it is
> being used in.

The one I quoted right at the start of this thread.

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


#26049

FromLawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
Date2011-02-07 15:45 +1300
Message-ID<iinmbe$9er$2@lust.ihug.co.nz>
In reply to#25667
In message <iinle7$3hi$1@news.eternal-september.org>, Joshua Cranmer wrote:

> On 02/06/2011 08:50 PM, Lawrence D'Oliveiro wrote:
>> In message<iiniqn$q4v$2@news.eternal-september.org>, Joshua Cranmer
>> wrote:
>>
>>> On 02/06/2011 06:31 PM, Lawrence D'Oliveiro wrote:
>>>
>>>> Is a type that “extends” T a subclass or a superclass of T?
>>>
>>> Neither. Types are not subclasses or superclasses of other things.
>>
>> What does “<=” mean, again?
> 
> In which context?

In the context of the language specification we happen to be discussing.

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


#25728

FromArved Sandstrom <asandstrom3minus1@eastlink.ca>
Date2011-02-06 08:48 -0400
Message-ID<SMw3p.72075$ZS4.20129@newsfe07.iad>
In reply to#25572
On 11-02-06 12:18 AM, Lawrence D'Oliveiro wrote:
> In message<40p3p.37003$5k5.12664@newsfe03.iad>, Arved Sandstrom wrote:
>
>> On 11-02-05 11:41 PM, Lawrence D'Oliveiro wrote:
>>
>>> In message<%8o3p.61505$8_2.1344@newsfe17.iad>, Arved Sandstrom wrote:
>>>
>>>> On 11-02-05 10:14 PM, Lawrence D'Oliveiro wrote:
>>>>
>>>>> In message<iijn9l$ccs$2@news.albasani.net>, Lew wrote:
>>>>>
>>>>>> Lawrence D'Oliveiro wrote:
>>>>>>
>>>>>>> * Section 4.5.1.1, page 55:
>>>>>>>
>>>>>>>          T<= ? extends T
>>>>>>>          T<= ? super T
>>>>>>>
>>>>>>> One of these is the wrong way round.
>>>>>>
>>>>>> Nope.  Both are true.
>>>>>
>>>>> In that case, why is one called an “upper bound” and the other a “lower
>>>>> bound”?
>>>>
>>>> Because the first (? extends T) specifies an upper bound (namely T), and
>>>> the second (? super T) specifies a lower bound (in this case also T).
>>>
>>> So do you understand what the “<=” symbol is supposed to represent?
>>>
>> It represents precisely and exactly what this sentence:
>>
>> "A type argument TA1 is said to contain another type argument TA2,
>> written TA2<= TA1, if the set of types denoted by TA2 is provably a
>> subset of the set of types denoted by TA1"
>
> So look again at the two relations I quoted above, and see how the
> definition you quoted is consistent with one of them, but not the other.
> Hint: go and look up the meaning of “extends” if you have to.

I'm cool with "extends" in wildcards, I use it often enough. Perhaps you 
should explain what you believe the problem to be.

AHS

-- 
We must recognize the chief characteristic of the modern era - a 
permanent state of what I call violent peace.
-- James D. Watkins

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


#25977

FromLawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
Date2011-02-07 12:31 +1300
Message-ID<iinavr$2up$5@lust.ihug.co.nz>
In reply to#25728
In message <SMw3p.72075$ZS4.20129@newsfe07.iad>, Arved Sandstrom wrote:

> On 11-02-06 12:18 AM, Lawrence D'Oliveiro wrote:
>
>> In message<40p3p.37003$5k5.12664@newsfe03.iad>, Arved Sandstrom wrote:
>>
>>> On 11-02-05 11:41 PM, Lawrence D'Oliveiro wrote:
>>>
>>>> In message<%8o3p.61505$8_2.1344@newsfe17.iad>, Arved Sandstrom wrote:
>>>>
>>>>> On 11-02-05 10:14 PM, Lawrence D'Oliveiro wrote:
>>>>>
>>>>>> In message<iijn9l$ccs$2@news.albasani.net>, Lew wrote:
>>>>>>
>>>>>>> Lawrence D'Oliveiro wrote:
>>>>>>>
>>>>>>>> * Section 4.5.1.1, page 55:
>>>>>>>>
>>>>>>>>          T<= ? extends T
>>>>>>>>          T<= ? super T
>>>>>>>>
>>>>>>>> One of these is the wrong way round.
>>>>>>>
>>>>>>> Nope.  Both are true.
>>>>>>
>>>>>> In that case, why is one called an “upper bound” and the other a
>>>>>> “lower bound”?
>>>>>
>>>>> Because the first (? extends T) specifies an upper bound (namely T),
>>>>> and the second (? super T) specifies a lower bound (in this case also
>>>>> T).
>>>>
>>>> So do you understand what the “<=” symbol is supposed to represent?
>>>>
>>> It represents precisely and exactly what this sentence:
>>>
>>> "A type argument TA1 is said to contain another type argument TA2,
>>> written TA2<= TA1, if the set of types denoted by TA2 is provably a
>>> subset of the set of types denoted by TA1"
>>
>> So look again at the two relations I quoted above, and see how the
>> definition you quoted is consistent with one of them, but not the other.
>> Hint: go and look up the meaning of “extends” if you have to.
> 
> I'm cool with "extends" in wildcards ...

Is a type that “extends” T a subclass or a superclass of T?

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


#26040

FromJoshua Cranmer <Pidgeot18@verizon.invalid>
Date2011-02-06 20:44 -0500
Message-ID<iiniqn$q4v$2@news.eternal-september.org>
In reply to#25977
On 02/06/2011 06:31 PM, Lawrence D'Oliveiro wrote:
> Is a type that “extends” T a subclass or a superclass of T?

Neither. Types are not subclasses or superclasses of other things.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

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


#26101

FromLawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
Date2011-02-07 14:50 +1300
Message-ID<iinj5g$7j3$2@lust.ihug.co.nz>
In reply to#26040
In message <iiniqn$q4v$2@news.eternal-september.org>, Joshua Cranmer wrote:

> On 02/06/2011 06:31 PM, Lawrence D'Oliveiro wrote:
>
>> Is a type that “extends” T a subclass or a superclass of T?
> 
> Neither. Types are not subclasses or superclasses of other things.

What does “<=” mean, again? 

[toc] | [prev] | [standalone]


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


csiph-web