caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Florian Hars <florian@hars.de>
To: Gerald heinig <Gerald.Heinig@ngi.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Newbie q. about Arg parsing
Date: Mon, 19 Aug 2002 18:42:07 +0200	[thread overview]
Message-ID: <3D611FDF.9030600@hars.de> (raw)
In-Reply-To: <3D5E1DD3.7CAF4F5E@ngi.de>

Gerald heinig wrote:
> let intarg = fun i -> Printf.printf "%d"

This function takes an arbitrary value "i", ignores it and then returns

   Printf.printf "%d"

which has type int -> unit, so your intarg has type

   'a -> int -> unit

which is probably not what you wanted (and not wat Arg.Int expects). Try

   let intarg = Printf.printf "%d"

or

   let intarg i = Printf.printf "%d" i

instead (the latter for should optimize better, but if you parse command line 
arguments in an inner loop you should refactor your program anyway).

Yours, Florian.

-------------------
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


      parent reply	other threads:[~2002-08-19 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-17  9:56 Gerald heinig
2002-08-17 15:32 ` Christophe Delage
2002-08-19 16:42 ` Florian Hars [this message]

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=3D611FDF.9030600@hars.de \
    --to=florian@hars.de \
    --cc=Gerald.Heinig@ngi.de \
    --cc=caml-list@inria.fr \
    /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).