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


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

Re: JLS 3/e -- Lots Of Errors

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: JLS 3/e -- Lots Of Errors
Date 2011-02-04 23:57 -0500
Organization albasani.net
Message-ID <iiilbn$spb$1@news.albasani.net> (permalink)
References <iiflvc$keg$2@lust.ihug.co.nz> <iihur6$v02$1@lust.ihug.co.nz>

Show all headers | View raw


On 02/04/2011 05:33 PM, Lawrence D'Oliveiro wrote:
> Here’s an example of what I mean, from section 5.1.10, pages 89-90:
>
>       5.1.10 Capture Conversion
>       Let G name a generic type declaration with n formal type parameters A1
>       ... An with corresponding bounds U1 ... Un. There exists a capture
>       conversion from G<T1 ... Tn>  to G<S1 ... Sn>, where, for 1 ≤ i ≤ n :
>      • If Ti is a wildcard type argument (§4.5.1) of the form ? then Si is a
>        fresh type variable whose upper bound is Ui[A1 := S1, ..., An := Sn]
>        and whose lower bound is the null type.
>      • If Ti is a wildcard type argument of the form ? extends Bi, then Si is
>        a fresh type variable whose upper bound is glb(Bi, Ui[A1 := S1, ...,
>        An := Sn]) and whose lower bound is the null type, where glb(V1,...
>        ,Vm) is V1&  ...&  Vm. It is a compile-time error if for any two
>        classes (not interfaces) Vi and Vj,Vi is not a subclass of Vj or vice
>        versa.
>      • If Ti is a wildcard type argument of the form ? super Bi, then Si is a
>        fresh type variable whose upper bound is Ui[A1 := S1, ..., An := Sn]
>        and whose lower bound is Bi.
>
> In all those three cases, Si occurs in its own definition. How are you

No, it doesn't.  In all those three cases, Si is defined.  Each of those three 
statements is a production of Si.

> supposed to make any sense of that circularity? It’s complete nonsense. The
> only way I can understand it is if all those instances of “Ui[A1 := S1, ...,
> An := Sn]” should actually be “Ui[A1 := T1, ..., An := Tn]”.
>

That would not be what they're trying to say.  They're saying that, taking the 
first one, the capture conversion is to a capture type Si with the upper bound 
Ui, where the formal parameter Ai is substituted with the capture type Si.  I 
do agree that their notation is obfuscatory, but there's no typo there.

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

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


Thread

Re: JLS 3/e -- Lots Of Errors Lew <noone@lewscanon.com> - 2011-02-04 23:57 -0500

csiph-web