Hi Pablo,
Follow explanation kindly provided by you
and Dr. Jon, I realize a source of my problem.
which my understanding of type and value is mixed.
Below you may see what I was confused...
# let al= [1, 'A']
type tuoed= { x: int; y: char }
let bm= { x= 1; y= 'A' } ;;
val al : (int * char) list = [(1, 'A')]
type tuoed = { x : int; y : char; }
val bm : tuoed = {x = 1; y = 'A'}
# bm.x = fst (List.hd al) ;;
- : bool = true
# bm.y == snd (List.hd al) ;;
- : bool = true
Type tuoed and type (int * char) list are
different, but both of their element are
the same, so actually my purpose is to
compare the contents of different types.
--- In ocaml_beginners%40yahoogroups.com">ocaml_beginners
yahoogroups.com, "Pablo Polvorin"
<pablo.polvorin
...> wrote:
>
> Hi Lorenzo,
> i am dont sure if i understand correctly you question, what you mean for
> "Are the both types the same thing, same thing?" ?.
>
> The first is a list of tuples, that contains only one tuple. A tuple
always
> contain a fixed number of values, which may be of different types.
>
> The second is a record, which is basically a tuple with named fields.
> Because it is a record,you have to explicitly define that type
before using
> it.
>
> regards
>
> --
> Pablo Polvorin
>
.