On Sat, 2008-09-13 at 08:18 -0400, Sandro Magi wrote: > Polymorphic data types have existential type [1]... > Oleg shows some interesting encodings of existentials using type > classes on that page, so perhaps no language extension at all is > required.
That isn't quite what that page says, and it isn't correct. Polymorphic data types, including those with qualifiers, remain universally quantified. The distinction between universal and existential quantification is that the type of a universally quantified variable eventually gets resolved and becomes known to the compiler -- even in Oleg's proposed encoding -- whereas knowledge of the existential type never escapes even to the compiler. The problem with saying that "its just a double negation" is that exclusive qualifiers do not combine well with inclusive qualifiers in an inference system. Mathematically, what Oleg is saying is perfectly valid, but from a practical standpoint it's not known how to get it working in an inference system. Note also that Oleg's characterization of implicit existentialism in objects is wrong. The issue has nothing to do with private fields. The compiler necessarily has full knowledge of those fields. Their privateness is purely syntactic sugar and does not invade the core semantics at all. The place where existentialism comes into play in objects is in inheritance and subtyping, where you may invoke using a superclass pointer but the actual method is a subclass method and receives a THIS pointer that is typed as the appropriate subclass. This problem is why virtual methods are not straightforwardly copy compatible with procedures. shap _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
