From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA01667; Fri, 30 Jan 2004 17:41:24 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA02009 for ; Fri, 30 Jan 2004 17:41:23 +0100 (MET) From: christophe.gensoul@epfl.ch Received: from mail0.epfl.ch (mail0.epfl.ch [128.178.50.57]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id i0UGfMv02918 for ; Fri, 30 Jan 2004 17:41:22 +0100 (MET) Received: (qmail 20327 invoked by uid 107); 30 Jan 2004 16:41:22 -0000 Received: from mailav1.epfl.ch (HELO MAILAV1) (128.178.50.190) by mail0.epfl.ch with SMTP; 30 Jan 2004 16:41:22 -0000 Received: From mail0.epfl.ch ([128.178.50.57]) by MAILAV1 (WebShield SMTP v4.5 MR1a); id 1075480878125; Fri, 30 Jan 2004 17:41:18 +0100 Received: from sicdec1.epfl.ch (128.178.50.33) by mail0.epfl.ch (AngelmatoPhylax SMTP proxy); Fri, 30 Jan 2004 17:41:22 +0100 Received: (from apache@localhost) by sicdec1.epfl.ch (8.11.6/8.11.6) id i0UGfMT11547 for caml-list@inria.fr; Fri, 30 Jan 2004 17:41:22 +0100 To: caml-list@inria.fr Subject: [Caml-list] Problem marshaling functions X-Imap-User: christophe.gensoul@epfl.ch Message-ID: <1075480882.401a893217a12@imapwww.epfl.ch> Date: Fri, 30 Jan 2004 17:41:22 +0100 (MET) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: IMP/PHP IMAP webmail program 2.2.8 X-Originating-IP: 80.238.53.82 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; marshaling:01 marshalling:01 marshalling:01 envirronment:01 marshaled:01 dependencies:01 arriving:01 marshaling:01 christophe:01 christophe:01 ocaml:01 behaviour:01 marshal:01 marshal:01 assert:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi list, I am working on a project in which function marshalling is of a great use. Actually I want to marshal and then send over the network list of partially applied functions (always top level functions). However the behaviour of such marshalling is not what I had expected. Actually I would like the following code to pass the assert : let a = ref 3;; let f() = !a let main () = let s = Marshal.to_string f [] in a := !a + 1; let g = Marshal.from_string s 0 in assert(g () = !a) ;; let () = main () The problem here is that the whole envirronment of the function seems to be marshaled (all its dependencies). Since the my programs all run the same code (imposed by function marshalling) wouldn't it be possible to marshal all free variables of the function "by reference". What I mean by that is that istead of marshalling the value of free variables, I'd like to marshal adresses of such variables. What I want to achieve is that all the state that is access in the function doesn't travel with it. When arriving at destination, I want to use the state of the destination (it's the same program on both side). The only thing I can imagine for achieving that is to modify the way marshaling does its job. But I really don't know how it work and where I should look in the source for changing that. Is it possible? If yes. Is it very complicated to do? Should it take a long time to achieve? Where can I find documentation on the implementation of the marshalling in OCaml? Thanks for any help. Christophe ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners