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
(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: Thomas Fischbacher <Thomas.Fischbacher@P...>
Subject: Re: [Caml-list] (int * int) <> int*int ?

> is anybody can semantically explain why this 2 types are differents ?

They are implemented in a different way internally. This is one of the 
dark corners of OCaml. 

(To my understanding, a constructor can carry multiple arguments, but 
depending on whether you put the parens or not, the tuple will be folded 
into a multi-slot constructor, or the constructor will have a single slot, 
which is a tuple.)

And yes, this *can* give you major headache if you first discover it when 
you try to raise a complex exception with sub-structure from within C 

We had this discussion earlier:

regards,                   (o_
 Thomas Fischbacher -  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)