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 AAA29497; Sat, 6 Sep 2003 00:45:07 +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 AAA20035 for ; Sat, 6 Sep 2003 00:45:06 +0200 (MET DST) Received: from mallaury.noc.nerim.net (smtp-105-friday.noc.nerim.net [62.4.17.105]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h85Mj5T03334 for ; Sat, 6 Sep 2003 00:45:05 +0200 (MET DST) Received: from karryall.dnsalias.org (karryall.dnsalias.org [62.4.18.180]) by mallaury.noc.nerim.net (Postfix) with ESMTP id 4AE4462D48; Sat, 6 Sep 2003 00:45:02 +0200 (CEST) Received: by karryall.dnsalias.org (Postfix, from userid 500) id 8A9121A034F; Sat, 6 Sep 2003 00:45:04 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <16217.4592.508630.765966@karryall.dnsalias.org> Date: Sat, 6 Sep 2003 00:45:04 +0200 To: Olivier Ricordeau Cc: caml-list@inria.fr Subject: Re: [Caml-list] weird compilation problem In-Reply-To: <3F5909A7.3060200@wanadoo.fr> References: <3F5909A7.3060200@wanadoo.fr> X-Mailer: VM 7.17 under Emacs 21.2.1 From: Olivier Andrieu X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 andrieu:01 andrieu:01 ocamlc:01 mli:01 foo:01 expr:01 mli:01 foo:01 expr:01 interfaces:01 olivier:02 olivier:02 compile:02 necessarily:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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. -- Olivier ------------------- 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