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
[Caml-list] classes and labels
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: wester@i...
Subject: [Caml-list] classes and labels

I have the class definition:

# class myclass ?(n=0) () =
   val nn = n;
   method get_nn = nn
   method clone (na: int) = let (mc: myclass) = new myclass ~n:na () in mc;
that produces the following error message in the toplevel:

          Characters 5-153:
The expression "new myclass" has type ?n:int -> unit -> myclass
but is used with type int -> unit -> myclass

Can sombody tell what is wrong with my class definition?
I would be very apprecitative for any help.

With kind regards

Rolf Wester
Rolf Wester
To unsubscribe, mail  Archives: