caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Gaurav Chanda" <gaurav_chanda@lycos.com>
To: caml-list@pauillac.inria.fr
Subject: [Caml-list] New Object Creation
Date: Sun, 07 Jul 2002 13:12:52 -0700	[thread overview]
Message-ID: <KDOKAGGEPNHINDAA@mailcity.com> (raw)

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


             reply	other threads:[~2002-07-07 20:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-07 20:12 Gaurav Chanda [this message]
2002-07-07 21:55 ` Alessandro Baretta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=KDOKAGGEPNHINDAA@mailcity.com \
    --to=gaurav_chanda@lycos.com \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).