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: Jim Farrand <jim.farrand@g...>
Subject: Re: [Caml-list] The Bridge Pattern in OCaml
On 28/03/2008, Michael Wohlwend <micha-1@fantasymail.de> 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