Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocaml 3.07 and optional arguments
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] ocaml 3.07 and optional arguments
From: "Vincent Barichard" <Vincent.Barichard@info.univ-angers.fr>

> I've just downloaded ocaml 3.07 and compil it. But when I try to compil old
> programs, I encounter some problems with optional arguments in methods.
[...]
> Is there any changes with the use of optional arguments for methods ?

I don't remember introducing any change at that level.

Your exemple is not detailed enough that I can infer the real cause.
You should submit a bug report including a minimal set of sources
producing the error.

A reasonable hypothesis is that you have fallen into the
non-principality of optional arguments (which is explained in the
manual). Try compiling your sources with ocaml 3.06, adding the option
ocamlc -principal.

If it tells you that some use is not principal, then the cause is the
increased polymorphism in 3.07: some type sharing appearing in 3.06
does not appear in 3.07. In general more polymorphism is a good thing,
but with non-principal features it may introduce incompatibilities.
Here, this would mean that you need another type annotation elsewhere.

Byt the way, why do you write
(sol#scalarizingFunction : ?weightVector':Solution.cWeightVector -> Solution
cPoint -> float)
rather than  "(sol : #Solution.solution)#scalarizingFunction"  ?

Jacques Garrigue

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