[Grace-core] [A Graceful Blog] Comment: "From Lancaster to Portland"

Kim Bruce kim at cs.pomona.edu
Tue Oct 11 16:53:19 PDT 2011


On Oct 11, 2011, at 4:09 PM, James Noble wrote:

>> It's a bit strange that they introduced intersection types in the language reference, but not in the language, as it seems to go against the 
>> philosophy of nominal typing.  I suppose they found it OK as the programmer never sees these types.
> 
> Mostly. except Java does have intersection types  - in type bounds you can write "T extends Foo & Bar" 
> 
> this is useful, this is why we should keep them in Grace
> 
> J
> 

Interesting.  I had never noticed that before, but then I usually name the types I use as upper bounds.

Kim

P.S.  Strangely, section 4.9 of the spec says you can't write intersection types, even though they are admitted in the case you give:

4.9 Intersection Types

An intersection type takes the form T1 & ... & Tn, n>0, where Ti, 1in, are type expressions. Intersection types arise in the processes of capture conversion (§5.1.10) and type inference (§15.12.2.7). It is not possible to write an intersection type directly as part of a program; no syntax supports this.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20111011/1e49e11b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lt_equal.gif
Type: image/gif
Size: 124 bytes
Desc: not available
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20111011/1e49e11b/attachment.gif>


More information about the Grace-core mailing list