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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 86349BC69 for ; Wed, 28 Mar 2007 14:51:45 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.230]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2SCpid0026430 for ; Wed, 28 Mar 2007 14:51:45 +0200 Received: by wx-out-0506.google.com with SMTP id i26so3021140wxd for ; Wed, 28 Mar 2007 05:51:43 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=ny5kH8Fc0o74PrER5OxOpp1FLNe7ZdG5S2qIxX9BYMUAVm+Y1eNPjkce0CYlGhKnP/ZI+1eZcujcWjbHGVMYNZmrpPoXOU5AICb0Frchh6zUihfie6BmuNpKOchrXexTk239kmgfP3Tfvrg9pedb0DVTJ4xVIZOHy+u3OIl3L2Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=Q/lV87cPZm9e+WfBcAEyYmgZNZxY9qnfdvfQUQHZtmt6ODR9//AgDuC8f/Kqum8QdwGov6udcz6X1tM3J2Cq/r6g6C+h4hE4CITl9dQJx+aJywB4vvHHyQRL6zkswFjfsQpJ0ZDKGhOW78yXE8qr20gHnoZdzTkhxSyKga9A7ow= Received: by 10.70.90.12 with SMTP id n12mr15258840wxb.1175086303851; Wed, 28 Mar 2007 05:51:43 -0700 (PDT) Received: from ?192.168.1.34? ( [88.8.239.112]) by mx.google.com with ESMTP id a23sm26543518nfc.2007.03.28.05.51.42; Wed, 28 Mar 2007 05:51:42 -0700 (PDT) In-Reply-To: <20070328142550.72f2f3a6@hmmm.de> References: <20070328142550.72f2f3a6@hmmm.de> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: Re: [Caml-list] Wrapping OCaml function returning a variant Date: Wed, 28 Mar 2007 13:51:39 +0100 To: micha X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 460A64E0.000 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 460A64E0.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 val:01 28,:98 2007,:98 char:01 wrote:01 caml-list:01 variant:02 string:02 string:02 labels:03 let:03 size:95 function:08 decode:08 One last question which I couldn't answer by browsing through mltypes.h... What is the type of a on the C side? Thanks, Joel On Mar 28, 2007, at 1:25 PM, micha wrote: > the labels are numbered starting from zero, so in c have have to > decode two possible values : > > let a= Success("xxx") ... > > is in C a block with tag 0 and size 1, to get the string write: > > char* s = String_val(Field(a,0)) -- http://wagerlabs.com/