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

Kim Bruce kim at cs.pomona.edu
Mon Sep 26 17:39:36 PDT 2011


Sorry, because of "contravariance".

Kim



On Sep 26, 2011, at 5:23 PM, Kim Bruce wrote:

> I was about to argue that we only needed a semi-lattice with sups, but it then occurred to me that because of covariance (related to subtyping function types), we need the joins as well.  
> 
> In fact, as I now recall, we ran into this with an OOPSLA paper where we ran into problems with typing conditional expressions, and we found we needed the entire lattice.  Because Java has conditional expressions, but no sups or infs (because of nominal typing), they do not fully support subtyping.  If expT: A <: C and expE: B <: C then "boolExp? expT: expE" is not typable in Java, even though it clearly has type C.
> 
> I also worried that banning overloading might make meets hard, but a little thought shows  we can just take the subtype of the different types in the join.
> 
> Kim
> 
> 
> 
> On Sep 26, 2011, at 4:01 PM, Andrew P. Black wrote:
> 
>> 
>> On 26 Sep 2011, at 15:16 , Kim Bruce wrote:
>> 
>>> I would probably choose not to have an all-purpose "Nil" object, but instead create a new one for each type that needed one. That way, each could be given any methods that we felt necessary (and those would be different for each application).  
>> 
>> I agree with this position.
>> 
>>> 
>>> I don't see any need for a special None type.  Can anyone enlighten me as to why we might need it?
>> 
>> So that types form a lattice.  If you don't have a None type, then meets (and consequently joins) may not always exist.  We want joins, so that we can type conditional expressions, and inheritance, and other things.
>> 
>> 	Andrew
>> 
> 
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20110926/2d19de65/attachment.html>


More information about the Grace-core mailing list