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 NAA11915; Tue, 28 May 2002 13:19:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA11943 for caml-list@pauillac.inria.fr; Tue, 28 May 2002 13:19:56 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA11010 for ; Tue, 28 May 2002 12:26:13 +0200 (MET DST) Received: from ep09.kernel.pl (ep09.kernel.pl [212.87.11.162]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4SAQCv04914 for ; Tue, 28 May 2002 12:26:12 +0200 (MET DST) Received: (qmail 1849 invoked by uid 566); 28 May 2002 10:26:01 -0000 Date: Tue, 28 May 2002 12:26:01 +0200 From: Michal Moskal To: Animesh Pathak Cc: caml-list@inria.fr Subject: Re: [Caml-list] help regarding 'union' Message-ID: <20020528102601.GB30829@ep09.kernel.pl> References: <200205280752.g4S7qsL08663@payia.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200205280752.g4S7qsL08663@payia.inria.fr> User-Agent: Mutt/1.3.28i X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, May 28, 2002 at 09:52:54AM +0200, Animesh Pathak wrote: > dear members, > I am new to caml and am currently trying to write a program which involves > sending of data across a network connection. What I have to do is to send a > complex structure (containing lists of integers, mutexes etc. ) across a > network. In C, i would have used a 'union' with a char array and sent the > array... how is it done in caml? > Kindly help me regarding this problem of mine. Look at module Marshal. You can convert any (well, non-cyclic) datastructure to string and send it. However beware that marshalled structures might be imcompatible between OCaml releases (they however are compatible (unlike C union solution) between different machines). -- : Michal Moskal ::::: malekith/at/pld-linux.org : GCS {C,UL}++++$ a? !tv : PLD Linux ::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h ------------------- 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