caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] New Object Creation
@ 2002-07-07 20:12 Gaurav Chanda
  2002-07-07 21:55 ` Alessandro Baretta
  0 siblings, 1 reply; 2+ messages in thread
From: Gaurav Chanda @ 2002-07-07 20:12 UTC (permalink / raw)
  To: caml-list

Hello 

I created 2 files : point.ml and point.mli. The first one contained a simple class definition.

class point =
        object
                value mutable x = 0;
                method addunit v = v+1 ;
        end;
The second one contained 

class type point =
        object
                value mutable x : int;
                method addunit : int -> int ;
        end;

I used this class in another file, test.ml which contained 

open Point;

value parse t = match t with
  [ "" -> let a = new point in
          ()
  |  _ -> ()
  ];

My compilation command was: 
ocamlopt -pp "camlp4r pa_extend.cmo" -I +camlp4  -c point.mli point.ml test.ml

However, on compilation I got an error message:

File "t2.ml", line 4, characters 18-27:
Unbound class point
make: *** [code] Error 2

I am not able to create a new point object from outside the file. Could you help me solve this problem ?

Gaurav



_____________________________________________________
Supercharge your e-mail with a 25MB Inbox, POP3 Access, No Ads
and NoTaglines --> LYCOS MAIL PLUS.
http://www.mail.lycos.com/brandPage.shtml?pageId=plus 
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-07 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-07 20:12 [Caml-list] New Object Creation Gaurav Chanda
2002-07-07 21:55 ` Alessandro Baretta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).