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 AAA27829; Tue, 11 Feb 2003 00:23:11 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 AAA27227 for ; Tue, 11 Feb 2003 00:23:11 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h1ANMvf07646; Tue, 11 Feb 2003 00:22:57 +0100 (MET) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA28056; Tue, 11 Feb 2003 00:22:56 +0100 (MET) From: Pierre Weis Message-Id: <200302102322.AAA28056@pauillac.inria.fr> Subject: Re: [Caml-list] Request: matrix_init function in Array In-Reply-To: from Brian Hurt at "Feb 10, 103 12:52:35 pm" To: brian.hurt@qlogic.com Date: Tue, 11 Feb 2003 00:22:56 +0100 (MET) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Any possibility we could add the following function to the Array module? > > val matrix_init : int -> int -> (int -> int -> 'a) -> 'a array array > > let matrix_init rows cols f = > let g i = init cols (f i) > in > init rows g > ;; > > Actually, I'm not sure if the function should be matrix_init or > init_matrix. And I don't care either way. > > Brian I think we need a Matrix module, such that it would be Matrix.init, Matrix.make, and so on. This would be much more convenient for beginners that are always caught by the famous Array.make raw (Array.make column 0.0). Hope this helps. Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- 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