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 CE73EBB84 for ; Fri, 19 May 2006 22:17:33 +0200 (CEST) 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 k4JKHXi3018307 for ; Fri, 19 May 2006 22:17:33 +0200 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 WAA28106 for ; Fri, 19 May 2006 22:17:32 +0200 (MET DST) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k4JKHVsV018301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 19 May 2006 22:17:32 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from first.in-berlin.de (e178040235.adsl.alicedsl.de [85.178.40.235]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id k4JKHU2f005379 for ; Fri, 19 May 2006 22:17:31 +0200 Received: by first.in-berlin.de (Postfix, from userid 501) id 688D4287B9E; Fri, 19 May 2006 22:17:34 +0200 (CEST) Date: Fri, 19 May 2006 22:17:34 +0200 From: Oliver Bandel To: caml-list Subject: Re: [Caml-list] Array 4 MB size limit Message-ID: <20060519201733.GF841@first.in-berlin.de> References: <20060515141230.ajyupn2z28k0484s@horde.akalin.cx> <446986DF.1070308@inria.fr> <446D5E4A.8060005@akalin.cx> <200605191315.33165.jon@ffconsultancy.com> <58530.207.171.180.101.1148067370.squirrel@207.171.180.101> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58530.207.171.180.101.1148067370.squirrel@207.171.180.101> User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at concorde with ID 446E27DD.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 446E27DB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 arrays:01 assertion:01 surprising:01 arrays:01 vectors:01 reuse:01 vectors:01 ocaml:01 ocaml:01 3.09.0:01 2006:98 2006:98 wrote: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.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Fri, May 19, 2006 at 03:36:10PM -0400, akalin@akalin.cx wrote: > > On Friday 19 May 2006 06:57, Frederick Akalin wrote: > >> > A better idea would be to determine exactly what data structure you > >> need: > >> > which abstract operations, what performance requirements, etc. C++ > >> > and Lisp programmers tend to encode everything as arrays or lists, > >> > respectively, but quite often these are not the best data structure > >> > for the application of interest. > >> > >> I find your assertion surprising. C++ and Common LISP are by no means > >> lacking in standard data structures (and using bare arrays is > >> discouraged in C++, as far as I know) and in my experience I haven't > >> much seen C++ code that used arrays/vectors when not appropriate. > > > > Yes, I would say that C and Fortran programmers overuse arrays because > > other > > data structures are prohibitively difficult to implement and reuse. > > I would agree with you on your statement about C and Fortran. However, I > was talking about C++, which has now grown far beyond its "C with Classes" > legacy. C++'s standard library includes all of the most common data > structures (maps, vectors, lists), so you'd have to go out of your way to > use arrays for everything. But IMHO even today these lists are not type-polymorphc like in OCaml. ================== first:~ oliver$ ocaml Objective Caml version 3.09.0 # List.map;; - : ('a -> 'b) -> 'a list -> 'b list = # List.map (fun x -> x * 3 ) [2; 5;1;22;4];; - : int list = [6; 15; 3; 66; 12] # List.map (fun str -> str ^ str ) [ "Hi"; "yes"; "hello"; "world" ];; - : string list = ["HiHi"; "yesyes"; "hellohello"; "worldworld"] # ================== Ciao, Oliver