Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] productivity improvement
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Rogoff <bpr@a...>
Subject: Re: [Caml-list] Array.resize ?
John Max Skaller writes:
> I might add that I have requested a variable length array, similar to a 
> C++ vector.
> It is possible to make one using pure Ocaml + a little Obj.magic. **

It's possible to write them without any unsafe primitives in core ML. 

> But it would be better if it were in the standard distribution.

I think a built in Dynarray or Vect module would probably be worthwhile. 

> [you need allocate initialise unused slots using Obj.magic ..
> this is considered naughty :-]

That depends on the interface you provide. If you only allow construction
through functions (and not [||]) you always have a default value. A 
builtin Dynarray needn't have this restriction, and would probably be
written in C anyways. 

> Similar for Strings .. though IMHO module String should be deprecated:
> we don't need Strings when we have Arrays.

I think I understand where you're coming from, but I think you really mean 
that we don't need Strings when we have Bigarrays. 

-- Brian
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners