Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Optional and mandatory labels with the same name in the same function ?
[ 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] Optional and mandatory labels with the same name in the same function ?
From: Berke Durak <durak@liafa.jussieu.fr>

> Has the following any use, and if not, shouldn't Ocaml better give a
> warning ?
> 
> # let f ?gogo ~gogo () = 33;;
> val f : ?gogo:'a -> gogo:'b -> unit -> int = <fun>
> 

Then I suppose that
   let f x x = 33
should also cause a warning, because this has just the same
semantics.

If your question was, is it possible to call such a function, then the
answer is yes:
   f ~gogo:1 ~gogo:2 ()

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