English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2006-02-23 (19:03)
From: Frédéric_Gava <gava@u...>
Subject: Re: [Caml-list] (int * int) <> int*int ?
> # type t=A of int*int and  t'= B of (int*int);;
> type t = A of int * int
> and t' = B of (int * int)
> See section 18.3.4 of the manual -- the distinction allows the runtime
> representation of t to avoid a level of indirection.

Thanks for your anwser but I am not convinced that is a good reason. If "t"
is better why " t' " is not automatically tranform into "t" (it is easy, you
just delete the global parens). ok (int->int)->int <> int->int->int or
int*int*int<>int*(int*int) . Morever I think that int*int=(int*int)
"everywhere" in ML...
# type t=int*int;;
type t = int * int
# type t'=(int*int);;
type t' = int * int

>And since the runtime representations are different, the types have to be
Wrong, you can the same representation but different types (e.g. int, char
or many other examples)