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 642FCBBCB for ; Fri, 28 Mar 2008 12:31:21 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhICANJz7EfRVZKwc2dsb2JhbACRMwEMAwQFCRSTb4VJ X-IronPort-AV: E=Sophos;i="4.25,569,1199660400"; d="scan'208";a="10778656" Received: from wa-out-1112.google.com ([209.85.146.176]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Mar 2008 12:31:20 +0100 Received: by wa-out-1112.google.com with SMTP id k17so247556waf.3 for ; Fri, 28 Mar 2008 04:31:19 -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=sFeSVcwJGdW4WSE0oJ9n5to4v/8XwyG10Ja7oJMymaE=; b=cuwSGuxyjPBHof8wSA9HbA4pGZcamw5Achdk1bnV4u/wCZRw9HI6BuSncBAj2ynz7YhoczFzwQmRBQ3vBlkxE1iVDgxtG4Yutij+8jiXnf9h+BmyZPYMJwwEWkEUPTLHszP8Ou/tfEO0NXkia3zjB7jPzMXZgSLyf810v+sV9FE= 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=LvFIN+9XJbT1GWFauvU6S1AZMnimuNYg/5jf2Yu4ovQ4yZrWY+Tbo+rzsChJHmd2me6up0H4KNB739fsOdCGQirZaKweJoFTxWG6nHgXesNow4I/VQIjIymfHGvcS3JPFBR0/EEyw9ABfFMwCTNZaXau/s8yQ5OQELodynjE0cc= Received: by 10.114.111.1 with SMTP id j1mr3397479wac.141.1206703758267; Fri, 28 Mar 2008 04:29:18 -0700 (PDT) Received: by 10.115.111.17 with HTTP; Fri, 28 Mar 2008 04:29:18 -0700 (PDT) Message-ID: Date: Fri, 28 Mar 2008 11:29:18 +0000 From: "Jim Farrand" To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] The Bridge Pattern in OCaml Cc: "Michael Wohlwend" In-Reply-To: <200803281206.30620.micha-1@fantasymail.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> <891bd3390803191907q5838ee66u83cb35e549805af0@mail.gmail.com> <200803281206.30620.micha-1@fantasymail.de> X-Spam: no; 0.00; ocaml:01 o'caml:01 closures:01 closures:01 wrote:01 encode:01 caml-list:01 closure:01 behaviour:01 behaviour:01 binary:02 encoding:02 pattern:04 representing:05 representing:05 On 28/03/2008, Michael Wohlwend wrote: > I would make my own format with a version number. > Maybe: > a complicated binary format, > a more text like format like json or yaml or xml *schockhorror* > or use a small db for storing, like sqlite. But how would you encode an O'Caml function/closure as, say, XML? As far as I know this isn't possible. My point is, I want to find some compromise between: - Representing behaviour as closures (very flexible, but not serializable), and - Representing behaviour without closures (serializable, but with huge loss of flexibility wrt. what the behaviour implementations can do - ie, the framework would have to predict in advance what kind of things the implementations might want to do in order to provide an encoding flexible enough). Regards, Jim