Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Fabrice Le Fessant <fessant@pa.dec.com>
To: knotwell@f5.com
Cc: Gerd.Stolpmann@darmstadt.netsurf.de, caml-list@inria.fr
Subject: Re: small code problem
Date: Thu, 8 Jul 1999 18:37:12 -0700 (PDT)	[thread overview]
Message-ID: <14213.21064.503662.843704@langouste.pa.dec.com> (raw)
In-Reply-To: <14213.16897.231203.976296@knotwell.f5.com>


 > This is a serious question (not an argumentative one).  How do I avoid 
 > Invalid_argument when I'm expecting the user to enter a filename on
 > the command-line?  Or are you just talking in general?

You can check the size of the array before reading it:

if Array.length Sys.argv < 2 then usage ();;
let filename = Sys.argv.(1)

will never raise an Invalid_argument exception.

- Fabrice

Homepage: http://pauillac.inria.fr/~lefessan




  reply	other threads:[~1999-07-10 18:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-02 22:30 <Brad Knotwell
1999-07-08  4:56 ` Markus Mottl
1999-07-08 22:49 ` Gerd Stolpmann
1999-07-09  0:27   ` <Brad Knotwell
1999-07-09  1:37     ` Fabrice Le Fessant [this message]
1999-07-08 18:23 Damien Doligez
     [not found] <199907090927.KAA09195@toy.william.bogus>
1999-07-09 13:56 ` Gerd Stolpmann
1999-07-11 19:23   ` Markus Mottl

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=14213.21064.503662.843704@langouste.pa.dec.com \
    --to=fessant@pa.dec.com \
    --cc=Gerd.Stolpmann@darmstadt.netsurf.de \
    --cc=caml-list@inria.fr \
    --cc=knotwell@f5.com \
    /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