Browse thread
Array 4 MB size limit
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Oliver Bandel <oliver@f...> |
| Subject: | Re: [Caml-list] Array 4 MB size limit |
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 = <fun>
# 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