<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/bc2a965ab496aafdf2907a6d9bf85822"
  from="Gaurav Chanda &lt;gaurav_chanda@l...&gt;"
  author="Gaurav Chanda"
  date="2002-07-07T20:13:03"
  subject="[Caml-list] New Object Creation"
  prev="2002/07/7a6ee632d474fca6535ff230e8cf2e20"
  next="2002/07/b4d857a65ae262207463c99e98abb5f7"
  next-in-thread="2002/07/55aaf067448698d1a8dd460ca582ba39"
  prev-thread="2002/07/362b26b59e19e369fc41bedf17213b18"
  next-thread="2002/07/0753c3188698d9ea0f77236a0e41c552"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] New Object Creation">
<msg 
  url="2002/07/bc2a965ab496aafdf2907a6d9bf85822"
  from="Gaurav Chanda &lt;gaurav_chanda@l...&gt;"
  author="Gaurav Chanda"
  date="2002-07-07T20:13:03"
  subject="[Caml-list] New Object Creation">
<msg 
  url="2002/07/55aaf067448698d1a8dd460ca582ba39"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-07T21:49:29"
  subject="Re: [Caml-list] New Object Creation">
</msg>
</msg>
</thread>

<contents>
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 -&gt; int ;
        end;

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

open Point;

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

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 --&gt; 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

</contents>

</message>

