Version française
Home     About     Download     Resources     Contact us    
Browse thread
(int * int) <> int*int ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] (int * int) <> int*int ?

On Feb 23, 2006, at 20:07, Frédéric Gava wrote:

> Morever I think that int*int=(int*int) "everywhere" in ML...

This is definitely not true.  Consider the following example:

$ ocaml
         Objective Caml version 3.09.2+dev4 (2006-02-09)

# let int = 0;;
val int : int = 0
# let t = [| 1 |];;
val t : int array = [|1|]
# t.(int*int);;
- : int = 1
# t.int*int;;
Unbound record field label int
#

This example is very similar to your problem.  The substring "int*int"
appears in your program, but it is not _by_itself_ a subexpression of  
your
program, so there is no reason why it should be equivalent to  
"(int*int)".

As Jacques said, what we have here is an unfortunate choice of syntax  
for
the declaration of n-ary constructors, combined with overloading of
constructor applications, to n arguments or to one tuple argument.

-- Damien