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 SAA12586; Mon, 19 Aug 2002 18:42:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA12640 for ; Mon, 19 Aug 2002 18:42:16 +0200 (MET DST) Received: from grisu.bik-gmbh.de (grisu.bik-gmbh.de [194.233.237.82]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7JGgFD07160 for ; Mon, 19 Aug 2002 18:42:15 +0200 (MET DST) Received: from hars.de (prony.bik-gmbh.de [194.233.237.133]) by grisu.bik-gmbh.de (8.12.3/8.11.1) with ESMTP id g7JGgCAK094068; Mon, 19 Aug 2002 18:42:13 +0200 (CEST) (envelope-from florian@hars.de) Message-ID: <3D611FDF.9030600@hars.de> Date: Mon, 19 Aug 2002 18:42:07 +0200 From: Florian Hars User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.0.0) Gecko/20020529 X-Accept-Language: de-de, en-us, en MIME-Version: 1.0 To: Gerald heinig CC: caml-list@inria.fr Subject: Re: [Caml-list] Newbie q. about Arg parsing References: <3D5E1DD3.7CAF4F5E@ngi.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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