From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9C6F2BC2F for ; Sat, 4 Dec 2004 12:03:45 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iB4B3jOq029373 for ; Sat, 4 Dec 2004 12:03:45 +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 MAA01031 for ; Sat, 4 Dec 2004 12:03:45 +0100 (MET) Received: from smtp2.wanadoo.fr (smtp2.wanadoo.fr [193.252.22.29]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iB4B3iJK029370 for ; Sat, 4 Dec 2004 12:03:44 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0203.wanadoo.fr (SMTP Server) with SMTP id 978801C001E4 for ; Sat, 4 Dec 2004 12:03:44 +0100 (CET) Received: from nono (ARouen-106-1-32-91.w80-14.abo.wanadoo.fr [80.14.22.91]) by mwinf0203.wanadoo.fr (SMTP Server) with SMTP id 46F6D1C001DB for ; Sat, 4 Dec 2004 12:03:44 +0100 (CET) Message-ID: <001501c4d9f1$1b1c4600$0100a8c0@mshome.net> From: =?iso-8859-1?Q?Fr=E9d=E9ric_Gava?= To: References: <9E571848-430E-11D9-AF66-000A95CDFBE4@cs.unc.edu> <281F644B-43EF-11D9-BA22-000D9345235C@inria.fr> <6FBBD2B0-44FC-11D9-AF66-000A95CDFBE4@cs.unc.edu> <1102062166.666.25.camel@localhost> Subject: Missing a function Date: Sat, 4 Dec 2004 12:05:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Miltered: at nez-perce with ID 41B19991.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41B19990.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; gava:01 gava:01 comparaison:01 stdlib:01 ocaml:01 hashtbl:01 cheers:01 ...:98 structures:01 int:01 int:01 data:02 data:02 frederic:03 frederic:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Hi, I have done a comparaison on three data structures of the stdlib of OCaml (I do parallel implementation of this data structure) and I find that the module Map does not contain any function for counting the number of elements of the data structure: Set, cardinal: t -> int Hashtbl, lenght : ('a,'b) t -> int Map, you have to do "let length the_map = fold (fun _ _ i -> i+1) the_map 0 " And Set and Hastbl have also fold... Is there an explanation (or is it just a missing ;-) ) ? Cheers, Frédéric Gava