From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 36BA5BB81 for ; Fri, 11 Nov 2005 05:54:49 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jAB4sm5u015732 for ; Fri, 11 Nov 2005 05:54:48 +0100 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 FAA10312 for ; Fri, 11 Nov 2005 05:54:42 +0100 (MET) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAB4scpX030773 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 11 Nov 2005 05:54:41 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id 72BDA73A56 for ; Fri, 11 Nov 2005 15:54:33 +1100 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20342-02 for ; Fri, 11 Nov 2005 15:54:33 +1100 (EST) Received: from pulp.rsise.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id 5F8CD73A51 for ; Fri, 11 Nov 2005 15:54:30 +1100 (EST) Received: by pulp.rsise.anu.edu.au (Postfix, from userid 1560) id 4EEDB2943A9; Fri, 11 Nov 2005 15:54:30 +1100 (EST) Date: Fri, 11 Nov 2005 15:54:30 +1100 From: Pietro Abate To: ocaml ml Subject: marshalling objects Message-ID: <20051111045430.GA17854@pulp.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-Miltered: at concorde with ID 43742418.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4374240E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; anu:01 marshalling:01 heap:01 val:01 endline:01 endline:01 anu:01 wire:98 blog:98 blog:98 abstract:01 node:01 node:01 closures:01 closures:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hi all, It's not clear to me if it is possible or not to marshall objects ? From my tests it is not the case (output_value: abstract value (outside heap).). Am I missing something ? What is common practice to send objects across the wire ? thanks, p --------- ex.ml class node = object val d = 1 end ;; let l = try let a = (new node) in let s = (Marshal.to_string a []) in print_endline "Success"; (Marshal.from_string s 0 : node) with Invalid_argument s -> print_endline ("Failed "^s) ; (new node) ;; let l = try let a = (new node) in let s = (Marshal.to_string a [Marshal.Closures]) in print_endline "Success"; (Marshal.from_string s 0 : node) with Invalid_argument s -> print_endline ("Failed "^s) ; (new node) ;; let l = try let a = (new node) in let s = (Marshal.to_string a [Marshal.No_sharing]) in print_endline "Success"; (Marshal.from_string s 0 : node) with Invalid_argument s -> print_endline ("Failed "^s) ; (new node) ;; let l = try let a = (new node) in let s = (Marshal.to_string a [Marshal.No_sharing;Marshal.Closures]) in print_endline "Success"; (Marshal.from_string s 0 : node) with Invalid_argument s -> print_endline ("Failed "^s) ; (new node) ;; -- ++ Blog: http://blog.rsise.anu.edu.au/?q=pietro ++ ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html