From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 5CB31D171 for ; Mon, 25 Jul 2005 13:35:43 +0200 (CEST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6PBZfOX005627 for ; Mon, 25 Jul 2005 13:35:42 +0200 Received: from rosella (ppp9-20.lns1.syd3.internode.on.net [59.167.9.20]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j6PBZZ6m054996; Mon, 25 Jul 2005 21:05:35 +0930 (CST) Subject: Re: [Caml-list] How to do this properly with OCaml? From: skaller To: Stephane Glondu Cc: caml-list@yquem.inria.fr In-Reply-To: <200507242345.13152.Stephane.Glondu@crans.org> References: <200507241623.13705.Stephane.Glondu@crans.org> <1122251570.9027.362.camel@localhost.localdomain> <200507242345.13152.Stephane.Glondu@crans.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-8fK26M3tlrHTP0nOKH2c" Date: Mon, 25 Jul 2005 21:35:35 +1000 Message-Id: <1122291335.6766.33.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Miltered: at nez-perce with ID 42E4CE8D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 arrays:01 ocaml:01 trivial:01 datatype:01 ...:98 ...:98 wrote:01 sourceforge:01 sourceforge:01 typing:01 functions:01 argument:01 btw:02 X-Attachments: type="application/pgp-signature" name="signature.asc" X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 --=-8fK26M3tlrHTP0nOKH2c Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2005-07-24 at 23:45 -0700, Stephane Glondu wrote: > It would surely be interesting. But now, we have moved from "using=20 > Obj.magic for better efficiency" to "modifying to collector"... Well, basically the real topic is how to implement variable length arrays. This is easy enough in C and C++: why should it be very hard or even impossible in Ocaml? > > However that turned what in C is a trivial set of > > library functions into a complex unreliable mess > > and left me wondering whether the encoding was > > properly transparent. >=20 > I agree that strongly-typedness makes things more intricate sometimes, bu= t=20 > it will not make me prefer C... :-) I agree, but C++ has stronger array typing than Ocaml, so this is the wrong place to make such an argument :) The language requirements with respect to initialisation are the difference: Ocaml requires all store to be initialised, C/C++ does not.=20 > BTW, for some purposes can also use another datatype such as a Map or a=20 > Set. They do not involve such problems, are quite efficient, and more=20 > enjoyable than in C... Yes sometimes: I just don't like not having a choice. --=20 John Skaller --=-8fK26M3tlrHTP0nOKH2c Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBC5M6GsRp8/9aGVGsRAhmBAJ9evZCkUFH2e/baO9IifARpklA5CwCfezV0 FMaOi9zl/Xkx039iFxxzcy8= =ERib -----END PGP SIGNATURE----- --=-8fK26M3tlrHTP0nOKH2c--