[bitc-dev] Objects without subtypes
Swaroop Sridhar
swaroop at cs.jhu.edu
Fri Oct 17 07:27:25 CDT 2008
Sandro Magi wrote:
> Jonathan S. Shapiro wrote:
>> What we now have in mind is to introduce a new constraint:
>>
>> (has-field 'a name 'b)
>>
>> which is satisfied when the type 'a has a field with the given /name/,
>> and that field in turn has type 'b. So the type of:
>>
>> (define (get-x v) v.x)
>> get-x (forall ((has-field 'a v 'b))
>> (fn 'a -> 'b))
>>
>> that is: we will now do polymorphic inference over field names.
>
> Isn't this just record polymorphism?
Yes. It is like Ocaml's row types expressed in constraint form
using the has-field constraint.
Swaroop.
More information about the bitc-dev
mailing list