Version française
Home     About     Download     Resources     Contact us    
Browse thread
The Bridge Pattern in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] The Bridge Pattern in OCaml
On Wed, 19 Mar 2008, Yaron Minsky wrote:

> On Wed, Mar 19, 2008 at 2:06 PM, Christopher L Conway <cconway@cs.nyu.edu>
> wrote:
>
>>
>> Are people here using this language feature in the real world? If so, how?
>
>
> For what it's worth, not at Jane Street.  We've looked at using existential
> types once or twice, but have yet to find a really compelling application.
> We don't really use objects much either.
>
> I'm actually a bit puzzled by your original post, in that I don't have a
> clear sense of what kind of situations you've run up against where using
> poor-man's objects (e.g., collections of closures wrapped up in a bundle)
> doesn't do the job.  On the whole, I've found that collections of closures
> are easier to think about than objects precisely because you don't have to
> worry about subtyping.  I'd be quite curious to hear about concrete examples
> where that approach doesn't fit well.

I find the biggest advantage of objects over records to be the same as 
polymorphic variants over classic variants:

- reusability of method names or variant names
- the same interface can be defined independently by 2 libraries without
   creating a dependency between them; later, objects (resp. poly.
   variants) coming from one library or another can be used
   interchangeably.


Martin

--
http://wink.com/profile/mjambon
http://martin.jambon.free.fr