[bitc-dev] Objects without subtypes

Jonathan S. Shapiro shap at eros-os.com
Fri Oct 17 11:47:45 CDT 2008


On Fri, 2008-10-17 at 12:44 -0400, Swaroop Sridhar wrote:
> Jonathan S. Shapiro wrote:
> > In O'Caml, field names are not scoped by their structure type. They are
> > global. In consequence, in the reference:
> > 
> >   x.y
> > 
> > The symbol resolver can resolve the field name 'y' without reference to
> > 'x'. Since 'y' is global, it is uniquely associated with exactly one
> > (possibly polymorphic) structure definition. The result is that O'Caml
> > never has to introduce any sort of constraint here -- the constraint is
> > "solved" immediately and uniquely at the use-occurrence.
> 
> This is true in the case of Ocaml structures. However, objects of a
> sub-class will have inherited fields.  To my understanding, the use of
> row-types here is similar to BitC's has-field constraint.

The difference in our cases is that it is possible for two structures
that do NOT have any inheritance (row extension) relationship to exist
simultaneously in the same scope, where both structures have a field
named "f".

shap



More information about the bitc-dev mailing list