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 6B44FBBC1 for ; Fri, 28 Mar 2008 13:43:45 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhICAGaF7EfRVZKxc2dsb2JhbACRMwEMAwQFCRSTbYVF X-IronPort-AV: E=Sophos;i="4.25,570,1199660400"; d="scan'208";a="10781307" Received: from wa-out-1112.google.com ([209.85.146.177]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Mar 2008 13:43:44 +0100 Received: by wa-out-1112.google.com with SMTP id k17so276892waf.3 for ; Fri, 28 Mar 2008 05:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=FBHAcBcB00IfdfXBNcVqhwnglmcS4fFqLZByhfcyvHA=; b=ifqtriUw5QnT91WEXkjhgrnFRQu0ASlAFGKsUgGLbRbIH2c6REO2y8xMW7FYGcaQyHUihPDLFZj0Rr8erzqYdxoAALGxXRYdIuWnalPPSg3dJxEwTAki2yRp8+kpdv7C6XaAklK6tKpZkywClVT01PyHmNvuUDzgU7YgtKPvQc4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DFqwkmkBb1SvOd/tmSbZtFyVJwKgf4WUDAff5Y9QOVTobQ7paj/b5RXaLDzpis+GzJt6tDv7vSHz9STY2fidkQndwVy3UrRgx+wFHGRJk7c2vhwxFhLhura5IICaKpHwL1wntmuQswGXCBseIUhK9Td4RlElFHrH0MgrzeUzqsw= Received: by 10.114.27.20 with SMTP id a20mr3578240waa.101.1206708222873; Fri, 28 Mar 2008 05:43:42 -0700 (PDT) Received: by 10.115.111.17 with HTTP; Fri, 28 Mar 2008 05:43:42 -0700 (PDT) Message-ID: Date: Fri, 28 Mar 2008 12:43:42 +0000 From: "Jim Farrand" To: "Oliver Bandel" Subject: Re: [Caml-list] The Bridge Pattern in OCaml Cc: caml-list@yquem.inria.fr In-Reply-To: <1206706146.47ecdfe275806@webmail.in-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4a051d930803190929q60d31012kb6c9d2b03a2d2ca6@mail.gmail.com> <1206703811.47ecd6c379853@webmail.in-berlin.de> <200803281252.41824.micha-1@fantasymail.de> <1206706146.47ecdfe275806@webmail.in-berlin.de> X-Spam: no; 0.00; ocaml:01 bandel:01 in-berlin:01 serialize:01 haskell:01 haskell:01 o'caml:01 o'caml:01 langauge:01 sub-language:01 ocaml:01 node:01 genius:98 wrote:01 oliver:01 On 28/03/2008, Oliver Bandel wrote: > Zitat von Michael Wohlwend : > Creating a datastrzucture, while creatzing the functionality. > And later, when you want to serialize what you have build up, > write that datastructure, you build by your own, to a file. > and when rereading it, this means: re-create the functionality from the > datastructure. > > Isn't this, what is looked for, here? Yes, this definitely solves the problem and meets the requirements I specified. In Haskell, it would be very neat - define a Monad for composing the ASTs and then code just like you would any other Haskell program, you're just using a different Monad from normal. In O'Caml, a lot less neat because the user providing the behaviour suddenly isn't really coding the algorithm in O'Caml, but creating a data-structure that represents the computation. But still, it definitely gets the job done. > This is in a way langauge implementation. > Isn't it? Yes, indeed. I guess that's what makes me hesitate. When a fairly simple problem like "allow calling modules to provide custom behaviour with serialisation" is answered with "implement a sub-language", it makes me worry that either the language or my design is inappropriate for the job, especially when other languages solve the same problem with relative ease. So I guess, I'm hoping for something more. :) (I'm very demanding I know, but this list regularly puts forward answer of such pure genius that I figure it's worth asking[1]) Thanks for your thoughts on the issue, Jim [1] http://ocaml.janestcapital.com/?q=node/18