From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id DAA17948; Sat, 6 Sep 2003 03:22:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA31662 for ; Sat, 6 Sep 2003 03:22:10 +0200 (MET DST) Received: from mallaury.noc.nerim.net (smtp-106-saturday.noc.nerim.net [62.4.17.106]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h861M9T13938 for ; Sat, 6 Sep 2003 03:22:09 +0200 (MET DST) Received: from wanadoo.fr (ricordeau.net1.nerim.net [213.41.149.166]) by mallaury.noc.nerim.net (Postfix) with ESMTP id A06B362D3B for ; Sat, 6 Sep 2003 03:22:05 +0200 (CEST) Message-ID: <3F5936C0.60300@wanadoo.fr> Date: Sat, 06 Sep 2003 03:22:08 +0200 From: Olivier Ricordeau User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.4) Gecko/20030630 X-Accept-Language: fr-fr, en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] weird compilation problem References: <3F5909A7.3060200@wanadoo.fr> <16217.4592.508630.765966@karryall.dnsalias.org> In-Reply-To: <16217.4592.508630.765966@karryall.dnsalias.org> X-Enigmail-Version: 0.76.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 hash:01 andrieu:01 ocamlc:01 mli:01 foo:01 expr:01 mli:01 foo:01 expr:01 lynx:01 1.2.3:01 wta:99 interfaces:01 olivier:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Olivier Andrieu wrote: > Olivier Ricordeau [Saturday 6 September 2003] : > > Hi! > > I have a weird compilation problem. ocamlc complains that it doesn't > > find a class, and I really don't know what mistake I made... > > FYI, it used to compile fine until I tried to write some interfaces. > > > If someone has an idea of what I did wrong, I'm interested! I'm quite > > stuck for now. > > [ je te l'ai déjà dit mais bon ... ] > > You're confusing class specification and class type. > > In corpus.ml you define a class, but in corpus.mli you put a class > type. A class type gives a "signature" of a class, listing its methods > and instance variable but a class type doesn't necessarily come with > an implementation (an actual class). So, when you try to use your > Corpus module, you only see a class type and you cannot create an > object with new or define a derived class. What you want is a class > specification. > > > Class definition (in .ml files) : > class foo = object method bar = some_expr end > > Class specification (in .mli files) : > class foo : object method bar : some_type_expr end > > Class type (in .ml and/or .mli files) : > class type foo = object method bar : some_type_expr end > > > Also, you do not really need to write a .mli if you're not hiding > anything from the .ml file. > It works! Thx a lot. - -- - -= *Olivier RICORDEAU* =- http://freefolks.org < LibNN addict http://libnn.org > lynx -source http://freefolks.org/key.asc | gpg --import olivier.ricordeau@wanadoo.fr _May the source be with you_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/WTa/DFRYKP6DJEwRAtNXAJ9uN1S4AHcy8MA42ctGi0tT4rCCaACghXxd x3PeHeCE4uBeA/t9Xo9M7J0= =TUBX -----END PGP SIGNATURE----- ------------------- 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