From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA31043; Fri, 12 Jul 2002 18:09:07 +0200 (MET DST) 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 SAA31037 for ; Fri, 12 Jul 2002 18:09:06 +0200 (MET DST) Received: from bastion.artisan.com (bastion.artisan.com [209.144.161.130]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6CG95f08823 for ; Fri, 12 Jul 2002 18:09:05 +0200 (MET DST) Received: from ypmaster.artisan.com (ypmaster [172.16.2.1]) by bastion.artisan.com (8.9.2/8.9.2) with ESMTP id JAA10203 for ; Fri, 12 Jul 2002 09:09:04 -0700 (PDT) Received: from granite.artisan.com (granite [172.16.10.97]) by ypmaster.artisan.com (8.9.2/8.9.2-arti) with ESMTP id JAA06891 for ; Fri, 12 Jul 2002 09:09:03 -0700 (PDT) Received: (from bpr@localhost) by granite.artisan.com (8.9.2/8.9.2) id JAA00617; Fri, 12 Jul 2002 09:09:03 -0700 (PDT) X-Authentication-Warning: granite.artisan.com: bpr set sender to bpr@artisan.com using -f From: Brian Rogoff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15662.65311.235108.509986@granite.artisan.com> Date: Fri, 12 Jul 2002 09:09:03 -0700 To: caml-list@inria.fr Subject: Re: [Caml-list] Array.resize ? References: <200207112228.SAA02692@dewberry.cc.columbia.edu> <3D2ED196.2060104@ozemail.com.au> X-Mailer: VM 7.00 under Emacs 20.7.1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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