From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 5AC9BBBCA for ; Thu, 20 Mar 2008 14:28:11 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As0CALYD4kdCbwQaemdsb2JhbACRBAEBCwMomRI X-IronPort-AV: E=Sophos;i="4.25,531,1199660400"; d="scan'208";a="10490953" Received: from out2.smtp.messagingengine.com ([66.111.4.26]) by mail3-smtp-sop.national.inria.fr with ESMTP; 20 Mar 2008 14:28:10 +0100 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 59D39D946A; Thu, 20 Mar 2008 09:28:09 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 20 Mar 2008 09:28:09 -0400 X-Sasl-enc: PEZIy280qI2Boaf+jQFm4j8olfccwdeiv/AavelP7EL6 1206019688 Received: from [192.168.1.10] (ALyon-157-1-20-67.w81-251.abo.wanadoo.fr [81.251.179.67]) by mail.messagingengine.com (Postfix) with ESMTPSA id 542E02DC6C; Thu, 20 Mar 2008 09:27:59 -0400 (EDT) Date: Thu, 20 Mar 2008 14:27:13 +0100 (CET) From: Martin Jambon X-X-Sender: martin@martin.ec.wink.com To: Yaron Minsky Cc: Christopher L Conway , Caml Mailing List Subject: Re: [Caml-list] The Bridge Pattern in OCaml In-Reply-To: <891bd3390803191907q5838ee66u83cb35e549805af0@mail.gmail.com> Message-ID: References: <4a051d930803190929q60d31012kb6c9d2b03a2d2ca6@mail.gmail.com> <0A1AD394-2F3B-488E-926B-1839C7C321E6@erratique.ch> <4a051d930803191044t1a1e9cb6h65ddbbda24cd7e1d@mail.gmail.com> <4a051d930803191106v74fa5de3j92530c3bf15ea9d5@mail.gmail.com> <891bd3390803191907q5838ee66u83cb35e549805af0@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam: no; 0.00; ens-lyon:01 ocaml:01 yaron:01 minsky:01 existential:01 subtyping:01 variants:01 variants:01 resp:01 polymorphic:01 closures:01 closures:01 wrote:01 wrote:01 caml-list:01 On Wed, 19 Mar 2008, Yaron Minsky wrote: > On Wed, Mar 19, 2008 at 2:06 PM, Christopher L Conway > 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