On 2010/11/05, at 21:58, Dario Teixeira wrote:
>> Can't you make foo_t and bar_t class types and foobar_t inherits them
>> both?
> 
> Thanks for the reply.  Yes, in the toy example I posted that would indeed
> be an alternative.  Still, I'm wondering about the most general case;
> suppose I had a function that took an object satisfying both foo_t and bar_t:
> 
> val do_something: < foo_t; bar_t; .. > -> bool
> 
> This is what I'm wondering if it's possible to express.

Same thing:

  class type foobar_t = object inherit foo_t inherit bar_t end
  val do_something : #foobar_t -> bool

I agree that this is rather verbose.
I thought a few times of adding the syntax you propose, but was always
stopped by the fact you can already do it in a verbose way.

Jacques Garrigue
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to