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 JAA05540; Wed, 17 Mar 2004 09:53:51 +0100 (MET) 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 JAA04980 for ; Wed, 17 Mar 2004 09:53:50 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mwinf0804.wanadoo.fr (smtp8.wanadoo.fr [193.252.22.23]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2H8sHKW028721 for ; Wed, 17 Mar 2004 09:54:17 +0100 Received: from vanicat.homelinux.org (ca-bordeaux-3-37.w80-8.abo.wanadoo.fr [80.8.75.37]) by mwinf0804.wanadoo.fr (SMTP Server) with ESMTP id B347018001E2 for ; Wed, 17 Mar 2004 09:53:49 +0100 (CET) Received: from moi by vanicat.homelinux.org with local (Exim 4.30) id 1B3Wo9-0001Rz-E2 for caml-list@inria.fr; Wed, 17 Mar 2004 09:53:49 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] quasi newbie question concerning modules presentatiion in the online O'Reilly book References: <20040317015505.55068.qmail@web41214.mail.yahoo.com> From: Remi Vanicat Mail-Copy-To: never Date: Wed, 17 Mar 2004 09:53:49 +0100 In-Reply-To: <20040317015505.55068.qmail@web41214.mail.yahoo.com> (Vasili Galchin's message of "Tue, 16 Mar 2004 17:55:05 -0800 (PST)") Message-ID: <87wu5jq2g2.dlv@vanicat.homelinux.org> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 newbie:01 mli:01 struct:01 131.:99 mli:01 compiles:01 struct:01 ocaml:01 ocaml:01 caml:01 sig:01 sig:01 writes:01 remi:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 151 Vasili Galchin writes: > Hello, > > I have been playing with the stack.mli plus > stack.ml implementation that respresents a stack as an > array. If I package as "module" sig and struct as > presented in > http://caml.inria.fr/oreilly-book/html/book-ora131.html#toc183 > > When I compile stack.mli and stack.ml as specified > here, I get an error complaining that the > implementation doesn't match the interface and also > missing a STACK field. If I comment all MODULE syntax > at the beginning and end of stack.mli and stack.ml, > then this stack compiles cleanly. Why? I believe you have wrote stack.mli : module type STACK = sig ... end and stack.ml : module Stack = struct ... end when you should have wrote stack.mli : ... stack.ml : ... ocaml already know that a mli is a signature, and a ml is a module. by the way, there is already a stack module in the ocaml standard library, maybe you could use it, or at least name yours differently. -- Rémi Vanicat ------------------- 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