Version française
Home     About     Download     Resources     Contact us    
Browse thread
Is this supposed to happen?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: onomoto@n...
Subject: Is this supposed to happen?
        (I've posted this to comp.lang.ml as well, but thought it ought to
be sent to the CAML list as well)


        This seems strange -- it's not at all what I wanted
to happen.  I'm running CAML-LIGHT on a Mac Centris 660AV.

(* begin code fragment *)
type foo ={
        a : int;
        b : string
} ;;

type bar = {
        a : int;
        c : float
} ;;

let v1 = {
        a = 1;
        b = "typefoo?"
} ;;

(* end fragment *)

        Running it through the interpreter, I get the following
error:
>.........{
>       a = 1;
>       b = "typefoo?"
>}...
> Expression of type bar
> cannot be used with type foo
- : unit = ()

        I'm a novice ML programmer, but I don't think I should
be getting that error -- help?

        Thanks in advance!

        -o