Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2003-09-30 (01:24)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] ocaml 3.07 and optional arguments
From: "Vincent Barichard" <>

> 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 Archives:
Bug reports: FAQ:
Beginner's list: