On Sat, Jan 4, 2014 at 7:01 AM, Sandro Magi <[email protected]> wrote:
> On 03/01/2014 8:40 PM, Jonathan S. Shapiro wrote: > >> Basically, Interfaces are the mechanism for existential quantification. >> > > interfaces = existential quantification + overloading > I am not sure how overloading gets in to this. > interfaces = existential quantification + single parameter type classes > I said that a while back, but I no longer think that is correct. An interface is existentially quantified over 'this exactly if it has non-static methods. An interface may be parametric. Type variables *other than* 'this are universally quantified. Those universally quantified variables can be subject to constraints. Because those type variables are universally quantified, I think that interfaces subsume multi-parameter type classes as well. The challenge in that isn't at the type layer. The challenge is at the data structure layer. If an interface has non-static parametric methods, those methods may need to be specialized in multiple ways within a single program, and each of those specializations will need its own slot in the ifTable. In a whole-program setting that's easy enough to compute. In a setting where we have separate compilation and dynamic linking, it is not obvious how to construct a consistent ifTable. I'm still scratching my head about that. > So the ultimate question is whether existentials are ever convenient > beyond overloading scenarios. You could be right, but since I'm not sure why this has anything to do with overloading, I don't really know. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
