From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id CB321D169 for ; Sun, 24 Jul 2005 23:08:35 +0200 (CEST) Received: from 26.mail-out.ovh.net (26.mail-out.ovh.net [213.186.42.179]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6OL8Z2l022548 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 24 Jul 2005 23:08:35 +0200 Received: (qmail 4257 invoked by uid 503); 24 Jul 2005 21:08:37 -0000 Received: (QMFILT: 1.0); 24 Jul 2005 21:08:37 -0000 Received: from b6.ovh.net (HELO mail47.ha.ovh.net) (213.186.33.56) by 26.mail-out.ovh.net with DES-CBC3-SHA encrypted SMTP; 24 Jul 2005 21:08:37 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 24 Jul 2005 21:08:35 -0000 Received: from mail47.ha.ovh.net (10.0.50.47) by mail47.ha.ovh.net with SMTP; 24 Jul 2005 21:08:33 -0000 Received: from b0.ovh.net (HELO queue-pre) (213.186.33.50) by b0.ovh.net with SMTP; 24 Jul 2005 21:08:32 -0000 Received: from adsl-69-229-239-54.dsl.scrm01.pacbell.net (HELO trantor.glondu.net) (postmaster%glondu.net@69.229.239.54) by ns0.ovh.net with SMTP; 24 Jul 2005 21:08:32 -0000 From: Stephane Glondu Organization: Crans To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to do this properly with OCaml? Date: Sun, 24 Jul 2005 14:08:28 -0700 User-Agent: KMail/1.7.1 Cc: skaller References: <1122236998.9027.163.camel@localhost.localdomain> <1122238196.9027.171.camel@localhost.localdomain> In-Reply-To: <1122238196.9027.171.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507241408.29014.Stephane.Glondu@crans.org> X-Ovh-Remote: 69.229.239.54 (adsl-69-229-239-54.dsl.scrm01.pacbell.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Miltered: at nez-perce with ID 42E40353.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 datatype:01 char:01 buffer:01 'char:01 char:01 buffer:01 o'caml:01 ...:98 ...:98 wrote:01 typing:01 typing:01 btw:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Sunday 24 July 2005 13:49, skaller wrote: > > > You can make it work for any datatype by using an 'a array option > > > instead of a string. > > > > That fails to be 'efficient'. Would you use > > > > char array option > > > > instead of the existing Buffer??? > > Woops, of course I meant 'char option array' :) Your question is the same as "Would you use a char array instead of a string"? My answer is no. But string can only store chars... BTW, I was talking about 'a array option, not 'a option array. You can use (mostly of) the implementation of Buffer, hence have the same efficiency... I don't understand your point about "efficiency". If you think that the Buffer implementation is not efficient, I may agree with you, but this is an algorithmic issue, not a typing issue. It has nothing to do with Obj.magic. Are you thinking about a specific implementation that you cannot do in O'Caml because of typing? If yes, tell us so we can help you get rid of Obj.magic if possible. -- Stephane Glondu.