Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Delegation based OO
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] Delegation based OO
Jacques Garrigue wrote:

> 
> Interesting idea. It would be even more useful now that one can define
> immediate objects (without explicitely defining a class).
> And recent changes on the implementation make direct delegation
> very cheap in terms of code size.
> Note however that one needs to know more clearly which methods are to
> be delegated, so I would rather favor a notation like:
> 
>  class does_more an_object = object
>     delegate does_something to an_object
>     ...
>  end

Ah! I see your point. Why not? Of course, delegating a class signature 
to an object allows you to define explicitely the type components which 
the type of does_more imports from the type of an_object. This would 
probably help the type checker a lot at giving sensible error messages.

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners