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: Martin Jambon <martin_jambon@e...>
Subject: Re: [Caml-list] [Q] explicit typing again
On Mon, 29 Mar 2004 fis@wiwi.hu-berlin.de wrote:

> hi,
>
> sorry, but i am really enthusiastic about explicit typing.  i will
> probably start to annotate expressions like "3" soon...  (-:
>
> 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, 2;;
val a : int = 1
val b : int = 2

# let (a, b : int * int) = 1, 2;;
val a : int = 1
val b : int = 2

You can add more ( ) around tuples, but here you don't really define
tuples.

In theory, you could find all this information here:
  http://caml.inria.fr/ocaml/htmlman/manual008.html

Martin


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