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 NAA20492; Sun, 30 Dec 2001 13:58:31 +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 NAA20392 for ; Sun, 30 Dec 2001 13:58:30 +0100 (MET) Received: from mel-rto1.wanadoo.fr (smtp-out-1.wanadoo.fr [193.252.19.188]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBUCwUT08223 for ; Sun, 30 Dec 2001 13:58:30 +0100 (MET) Received: from amyris.wanadoo.fr (193.252.19.150) by mel-rto1.wanadoo.fr; 30 Dec 2001 13:58:25 +0100 Received: from oops (193.251.66.253) by amyris.wanadoo.fr; 30 Dec 2001 13:58:09 +0100 Received: from david by oops with local (Exim 3.33 #1 (Debian)) id 16KfXU-00008e-00; Sun, 30 Dec 2001 13:58:08 +0100 To: Ian Zimmerman Cc: caml-list@inria.fr (OCAML) Subject: Re: [Caml-list] Array.make References: <86u1u9hdqp.fsf@speakeasy.org> From: david.mentre@wanadoo.fr (David =?iso-8859-1?q?Mentr=E9?=) Date: 30 Dec 2001 13:58:08 +0100 In-Reply-To: <86u1u9hdqp.fsf@speakeasy.org> Message-ID: <874rm8n9un.fsf@oops.i-did-not-set--mail-host-address--so-shoot-me> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Ian Zimmerman writes: > raises an exception when n = 0. Why? It looks like an unnecessary > special case. The damned hysterical raisins again? Was a bug in the doc. Fixed in latest release (3.04): val make : int -> 'a -> 'a array [...] Raise Invalid_argument if n < 0 or n > Sys.max_array_length. > BTW, the documentation also doesn't say how Array.init behaves in this > respect. Same behavior as Array.make (ok, maybe it should be in the doc). BTW, it seems that check is made using same code as Array.make (haven't look at the code): # Array.init 0 (fun x -> 0) ;; - : int array = [||] # Array.init (-1) (fun x -> 0) ;; Exception: Invalid_argument "Array.make". ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr