Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] [Q] explicit typing again
[ 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] [Q] explicit typing again
From: fis@wiwi.hu-berlin.de
> could anybody tell me how i get this one straight?
> 
> # let (a: int, b) = (1, 3) in a;;
> # let (a, b) : int * int = (1, 3) in a;;

# let (a : int), b = (1,3) in a;;
# let (a, b : int * int) = (1,3) in a;;

Pairs do not need parentheses.
Type annotations do (except when defining a single value).

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