caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] ocaml 3.07 and optional arguments
@ 2003-09-30 19:18 Arturo Borquez
  2003-10-01  0:04 ` Jacques Garrigue
  0 siblings, 1 reply; 11+ messages in thread
From: Arturo Borquez @ 2003-09-30 19:18 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: caml-list

Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp> wrote:

>> 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.
>
>After another bug report, it seems that a parsing bug went into camlp4
>just before the release :-(
>
>        Camlp4 Parsing version 3.07
>
># fun (f : ?x:int -> bool -> float) -> f true;;
>This expression has type bool but is here used with type ?x:int -> bool
># fun (f : ?x:int -> bool -> float) -> f;;
>- : ((?x:int -> bool) -> float) -> (?x:int -> bool) -> float = <fun>
>
>This is apparently a priority problem.
>A workaround is to explicitly add parentheses.
>
># fun (f : ?x:int -> (bool -> float)) -> f true;;
>- : (?x:int -> bool -> float) -> float = <fun>
>
>There is no fix for camlp4 itself yet.
>
>      Jacques Garrigue
>

Hi,

Is there a patch planned soon to solve this issue?

Best regards

-- 
Arturo Borquez


__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Caml-list] ocaml 3.07 and optional arguments
@ 2003-10-01 20:28 Arturo Borquez
  2003-10-01 23:51 ` Jacques Garrigue
  0 siblings, 1 reply; 11+ messages in thread
From: Arturo Borquez @ 2003-10-01 20:28 UTC (permalink / raw)
  To: Alain.Frisch; +Cc: caml-list

Alain.Frisch@ens.fr wrote:

>On Wed, 1 Oct 2003, Yaron Minsky wrote:
>
>> Having been bitten by this bug myself (which appears to hit labeled
>> arguments in general, not just optional arguments), I'd be quite eager for
>> a rerelease of 3.07 (3.07.1?) that fixes this problem.  It's a pretty
>> serious bug, especially if camlp4 is to be thought of as a real part of
>> the core system.
>
>I second that. Hopefully, OCaml 3.07+beta2 is still available, because it
>is the only version that can compile the CVS branch of CDuce... Please
>don't remove it!
>
>-- Alain
>

I have applied de patch and the problem persists, rebuilding
3.07 with the last hours CVS sources yields same results, so I've
reinstalled 3.07+beta2.

Best regards

-- 
Arturo Borquez


__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Caml-list] ocaml 3.07 and optional arguments
@ 2003-09-29 18:13 Vincent Barichard
  2003-09-30  1:24 ` Jacques Garrigue
  0 siblings, 1 reply; 11+ messages in thread
From: Vincent Barichard @ 2003-09-29 18:13 UTC (permalink / raw)
  To: CAML LIST

Hi all,

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.
In fact I have the following method in a class called Solution:

 method scalarizingFunction ?weightVector' referenceSolution =
    match weightVector' with
     None -> self#doScalarizingFunction referenceSolution
    | Some y -> self#doScalarizingFunction' y referenceSolution

where referencePoint is a Solution.cPoint type object, and weighVector' a
Solution.weightVector type object.
and in another source file, I have the call:

  let newScalarizingFunctionValue = 
(sol#scalarizingFunction : ?weightVector':Solution.cWeightVector -> Solution
cPoint -> float) referencePoint in .....

With ocaml 3.06, It compiles fine, but with ocaml 3.07 I'va got the
following error:

ocamlc -I ../Common -I ../Exact -I ../TS -I ../SA -I ../EA -I ../HGA -g -pp
camlp4o unix.cma -c ../SA/mOSA.ml
File "../SA/mOSA.ml", line 64, characters 135-149:
This expression has type
  Solution.cPoint =
    < augment : Solution.cPoint -> Solution.cPoint -> unit;
      compare : Solution.cPoint -> Global.comparison; copy : Solution.cPoint

      distance : Solution.cPoint ->
                 Solution.cPoint -> Solution.cPoint -> float;
      get_OV : int -> float; get_OV_size : int;
      linearScalarizingFunction : Solution.cWeightVector ->
                                  Solution.cPoint -> float;
      load : char Stream.t -> unit;
      minmaxScalarizingFunction : Solution.cWeightVector ->
                                  Solution.cPoint -> float;
      save : out_channel -> unit; set_OV : int -> float -> unit >
but is here used with type
  ?weightVector':Solution.cWeightVector -> Solution.cPoint
make: *** [../SA/mOSA.cmo] Error 2

Is there any changes with the use of optional arguments for methods ?
I didn't find any clue in the ocaml 3.07 documentation.

Thanks you for your help.

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-10-01 23:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-30 19:18 [Caml-list] ocaml 3.07 and optional arguments Arturo Borquez
2003-10-01  0:04 ` Jacques Garrigue
2003-10-01  8:43   ` Christophe Raffalli
2003-10-01 15:45     ` Yaron Minsky
2003-10-01 15:54       ` Alain.Frisch
  -- strict thread matches above, loose matches on Subject: below --
2003-10-01 20:28 Arturo Borquez
2003-10-01 23:51 ` Jacques Garrigue
2003-09-29 18:13 Vincent Barichard
2003-09-30  1:24 ` Jacques Garrigue
2003-09-30  3:07   ` Jacques Garrigue
2003-09-30  5:29     ` Vincent Barichard

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