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
syntax question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-05-30 (12:17)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] syntax question
On 2008-05-30, at 03:13, Michael Vanier wrote:

> I realize that this is how it works, but I don't understand why it  
> should work this way. AFAIK elsewhere in ocaml "int * int" always  
> refers to a tuple.

Almost, but not quite:

   # let int = 2;;
   val int : int = 2
   # int * int;;
   - : int = 4

Seriously, it's only an ergonomy problem in the syntax of type  
Some better alternatives would be:

   type testme = Foo (int, int);;

or, if you like keyword-oriented syntax:

   type testme = Foo of int and int;;

But in any case, it's way too late to fix this problem now, so we have  
live with it, at least in the classic syntax.

-- Damien