Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2002-07-12 (16:09)
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 Archives:
Bug reports: FAQ:
Beginner's list: