Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: