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.4 required=5.0 tests=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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id F0F0EBBAF for ; Mon, 23 Feb 2009 10:46:27 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgCAKD/oUmBWB4BgWdsb2JhbACNEYdNAQEWIsBOhA8G X-IronPort-AV: E=Sophos;i="4.38,253,1233529200"; d="vcf'?scan'208";a="23364531" Received: from imag.imag.fr ([129.88.30.1]) by mail3-smtp-sop.national.inria.fr with ESMTP; 23 Feb 2009 10:46:27 +0100 Received: from rubi.imag.fr (rubi.imag.fr [147.171.129.3]) by imag.imag.fr (8.13.8/8.13.8) with ESMTP id n1N9fvqH012366; Mon, 23 Feb 2009 10:41:57 +0100 (CET) Received: from [147.171.140.31] (diamante.imag.fr [147.171.140.31]) by rubi.imag.fr (8.11.7p2+Sun/8.11.3/ImagV2) with ESMTP id n1NA5b024645; Mon, 23 Feb 2009 11:05:37 +0100 (MET) Message-ID: <49A26EDF.9050403@imag.fr> Date: Mon, 23 Feb 2009 10:39:43 +0100 From: Florent Ouchet Reply-To: florent.ouchet@imag.fr Organization: Tima/VDS User-Agent: IceDove 1.5.0.14eol (X11/20080509) MIME-Version: 1.0 To: Su Zhang , caml-list@yquem.inria.fr Subject: Re: [Caml-list] a question bout exetract a sub-element of element in triple References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------060600000806060405090309" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (imag.imag.fr [129.88.30.1]); Mon, 23 Feb 2009 10:41:57 +0100 (CET) X-IMAG-MailScanner-Information: Please contact MI2S MIM for more information X-IMAG-MailScanner: Found to be clean X-IMAG-MailScanner-SpamCheck: X-IMAG-MailScanner-From: florent.ouchet@imag.fr X-Spam: no; 0.00; advices:01 denotes:01 ocaml:01 cheers:01 beginners:01 integer:01 caml-list:01 int:01 int:01 imag:02 groups:02 suited:02 element:03 element:03 let:03 X-Attachments: cset="utf-8" name="florent.ouchet.vcf" name="florent.ouchet.vcf" This is a multi-part message in MIME format. --------------060600000806060405090309 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Su Zhang a écrit : > I encountered a new problem which is I want to get " 1 " from a triple > "(0,2,[1,2,3])", which means I want to get the first value of the > third item in one triple and itself is a list, but when I use the > List.hd (third(0,2,[1,2,3])), it will give me the entire list which is > [1,2,3] > the definition of the third is "let third(x,y,z)=z", so is there a way > I can get out "1" from "(0,2,[1,2,3])"? if possible, would you please > give me some advices? Hi, [1,2,3] is equivalent to [(1,2,3)], which means "a list containing one element whose type is (int*int*int)". first (List.hd (third(0,2,[1,2,3]))) = 1 [1;2;3] denotes a list of three integer elements. List.hd (third(0,2,[1;2;3])) = 1 As said in a reply to your previous message, you'll get more complete answers by posting to this more suited group: http://groups.yahoo.com/group/ocaml_beginners Cheers, Florent --------------060600000806060405090309 Content-Type: text/x-vcard; charset=utf-8; name="florent.ouchet.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="florent.ouchet.vcf" begin:vcard fn:Florent Ouchet n:Ouchet;Florent org:;CIS/VDS adr;quoted-printable:46, avenue F=C3=A9lix Viallet,;;TIMA Laboratory - T131;GRENOBLE Cedex;;38031;France email;internet:florent.ouchet@imag.fr title:PhD student tel;work:0476574872 x-mozilla-html:FALSE url:http://tima.imag.fr version:2.1 end:vcard --------------060600000806060405090309--