caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: david.mentre@wanadoo.fr (David Mentré)
To: Ian Zimmerman <itz@speakeasy.org>
Cc: caml-list@inria.fr (OCAML)
Subject: Re: [Caml-list] Array.make
Date: 30 Dec 2001 13:58:08 +0100	[thread overview]
Message-ID: <874rm8n9un.fsf@oops.i-did-not-set--mail-host-address--so-shoot-me> (raw)
In-Reply-To: <86u1u9hdqp.fsf@speakeasy.org>

Ian Zimmerman <itz@speakeasy.org> 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


  reply	other threads:[~2001-12-30 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-29 22:18 Ian Zimmerman
2001-12-30 12:58 ` David Mentré [this message]
2002-01-04 13:35 ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874rm8n9un.fsf@oops.i-did-not-set--mail-host-address--so-shoot-me \
    --to=david.mentre@wanadoo.fr \
    --cc=caml-list@inria.fr \
    --cc=itz@speakeasy.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).