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 MAA14736; Fri, 15 Aug 2003 12:52:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA05028 for ; Fri, 15 Aug 2003 12:52:36 +0200 (MET DST) Received: from qrnik.knm.org.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h7FAqXT10537 for ; Fri, 15 Aug 2003 12:52:35 +0200 (MET DST) Received: from localhost ([127.0.0.1] ident=qrczak) by qrnik.knm.org.pl with esmtp (Exim 3.36 #1) id 19ncC8-00026o-00 for caml-list@inria.fr; Fri, 15 Aug 2003 12:52:32 +0200 From: "Marcin 'Qrczak' Kowalczyk" To: caml-list@inria.fr Subject: Re: [Caml-list] Obj.magic, Obj.t etc. Date: Fri, 15 Aug 2003 12:52:31 +0200 User-Agent: KMail/1.5.1 References: <200308141245.13230.qrczak@knm.org.pl> <1060943577.22302.46.camel@localhost.localdomain> In-Reply-To: <1060943577.22302.46.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200308151252.32049.qrczak@knm.org.pl> X-Loop: caml-list@inria.fr X-Spam: no; 0.00; marcin:01 'qrczak':01 kowalczyk:01 qrczak:01 caml-list:01 32,:01 inserts:01 generics:01 arrays:01 compiler:01 ocaml:01 imho:01 int:01 arithmetic:01 knm:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dnia pią 15. sierpnia 2003 12:32, skaller napisał: > > But now the check is required before polymorphic access. It happens in > > inner loops in almost all functions from the Array module. > > Then you lift the check out of the loop: > one check, two loops specialised for each case. It's not me who inserts the check, it's the OCaml compiler. Lifting it out of loops and of recursive functions like Array.to_list and Array.of_list would have to be done by the compiler. IMHO a separate float_array type would be better. The main problem is that it would need a different syntax for element access and separate versions of Array functions. You couldn't use the same code polymorphically for int and float arrays, but we don't have polymorphic arithmetic anyway... I wonder if it's improved when generics are adopted. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ ------------------- 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