Browse thread
(int * int) <> int*int ?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Alessandro Baretta <a.baretta@s...> |
| Subject: | Re: [Caml-list] (int * int) <> int*int ? |
Frédéric Gava wrote: >>And since the runtime representations are different, the types have to be >>different. > Wrong, you can the same representation but different types (e.g. int, char > or many other examples) Be careful when you reason about a proposition like "if A then B" in negated terms. You are stating that "if (runtime representations are different) then (types are different)" is false because "if not (runtime representations are different) then not (types are different)" is false, but the second proposition is not equivalent to the first. *** Back to the original topic: this is a syntactic issue. DdR has solved the issue in revised syntax, by making it very clear that 'a * 'b is a tuple, while an n-ary constructor takes n distinct formal parameters--by no means an n-uple. This is one of the very few spots where revised syntax is really more attractive than the original one. > type t = [ A of t1 and t2 ] > type t' = [ A of (t1 * t2) ] Alex -- ********************************************************************* Ing. Alessandro Baretta Studio Baretta http://studio.baretta.com/ Consulenza Tecnologica e Ingegneria Industriale Technological Consulting and Industrial Engineering tel. +39 02 370 111 55 fax. +39 02 370 111 54