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 UAA06906; Mon, 29 Sep 2003 20:13:38 +0200 (MET DST) 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 UAA15971 for ; Mon, 29 Sep 2003 20:13:35 +0200 (MET DST) Received: from ioskeha.hittite.isp.9tel.net (ioskeha.hittite.isp.9tel.net [62.62.156.27]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h8TIDYH20659 for ; Mon, 29 Sep 2003 20:13:34 +0200 (MET DST) Received: from lanfeust (unknown [81.185.59.203]) by ioskeha.hittite.isp.9tel.net (Postfix) with SMTP id D97A017B7DF for ; Mon, 29 Sep 2003 20:13:28 +0200 (CEST) MIME-Version: 1.0 Message-Id: <3F78763D.000003.03248@lanfeust> Date: Mon, 29 Sep 2003 20:13:17 +0200 (Paris, Madrid) Content-Type: Text/Plain X-Mailer: IncrediMail 2001 (2001177) From: "Vincent Barichard" X-FID: PLAINTXT-NONE-0000-0000-000000000000 X-FVER: 3.0 X-CNT: ; Content-Transfer-Encoding: quoted-printable X-Priority: 3 To: "CAML LIST" Subject: [Caml-list] ocaml 3.07 and optional arguments X-Loop: caml-list@inria.fr X-Spam: no; 0.00; barichard:01 barichard:01 univ-angers:01 3.07:01 3.07:01 compil:01 compil:01 cpoint:01 sol:99 cpoint:01 3.06,:01 compiles:01 ocamlc:01 -pp:01 camlp:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all,=0D =0D I've just downloaded ocaml 3.07 and compil it. But when I try to compil o= ld programs, I encounter some problems with optional arguments in methods.=0D In fact I have the following method in a class called Solution:=0D =0D method scalarizingFunction ?weightVector' referenceSolution =3D=0D match weightVector' with=0D None -> self#doScalarizingFunction referenceSolution=0D | Some y -> self#doScalarizingFunction' y referenceSolution=0D =0D where referencePoint is a Solution.cPoint type object, and weighVector' a Solution.weightVector type object.=0D and in another source file, I have the call:=0D =0D let newScalarizingFunctionValue =3D =0D (sol#scalarizingFunction : ?weightVector':Solution.cWeightVector -> Solut= ion cPoint -> float) referencePoint in .....=0D =0D With ocaml 3.06, It compiles fine, but with ocaml 3.07 I'va got the following error:=0D =0D ocamlc -I ../Common -I ../Exact -I ../TS -I ../SA -I ../EA -I ../HGA -g -= pp camlp4o unix.cma -c ../SA/mOSA.ml=0D File "../SA/mOSA.ml", line 64, characters 135-149:=0D This expression has type=0D Solution.cPoint =3D=0D < augment : Solution.cPoint -> Solution.cPoint -> unit;=0D compare : Solution.cPoint -> Global.comparison; copy : Solution.cPo= int =0D distance : Solution.cPoint ->=0D Solution.cPoint -> Solution.cPoint -> float;=0D get_OV : int -> float; get_OV_size : int;=0D linearScalarizingFunction : Solution.cWeightVector ->=0D Solution.cPoint -> float;=0D load : char Stream.t -> unit;=0D minmaxScalarizingFunction : Solution.cWeightVector ->=0D Solution.cPoint -> float;=0D save : out_channel -> unit; set_OV : int -> float -> unit >=0D but is here used with type=0D ?weightVector':Solution.cWeightVector -> Solution.cPoint=0D make: *** [../SA/mOSA.cmo] Error 2=0D =0D Is there any changes with the use of optional arguments for methods ?=0D I didn't find any clue in the ocaml 3.07 documentation.=0D =0D Thanks you for your help.=0D =0D Vincent ------------------- 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