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 OAA13317; Fri, 23 May 2003 14:51:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA13431 for ; Fri, 23 May 2003 14:51:44 +0200 (MET DST) Received: from mail.SC-Networks.de ([213.131.194.65]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4NCpeH21373 for ; Fri, 23 May 2003 14:51:42 +0200 (MET DST) Received: from irrgang by mail.SC-Networks.de with local (Exim 3.34 #1) id 19JBy2-0002Oj-00 for caml-list@inria.fr; Fri, 23 May 2003 14:48:14 +0200 Date: Fri, 23 May 2003 14:48:14 +0200 From: g.o.d@zefix.tv To: caml-list@inria.fr Subject: [Caml-list] newbie problem with splitting code into files Message-ID: <20030523124814.GD5371@sfear.sc-networks.de> Reply-To: g.o.d@zefix.tv Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Spam: no; 0.00; newbie:01 val:01 printf:01 mli:01 ocaml:01 mutable:01 int:01 match:02 compile:02 interface:03 refuses:03 object:03 let:04 functional:06 type:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, i am a bloody ocaml newbie. i have big problems with learning ocaml as my brain refuses to thing functional... is get better slowly. i studied several documentation sources but i was not able to find a solution for the following problem: i want to split code like for example the following into several files: -------------------- 8< -------------------- class type test_type = object val mutable x:int method get_x:int end;; class test : test_type = object val mutable x = 0 method get_x = x end;; let main() = let t=new test in printf "X: %d\n" t#get_x;; let _ = main() -------------------- 8< -------------------- as long as i keep this in one file it works. so what i did now is splitting it up, putting class type declaration into test.mli, putting class declaration into test.ml and putting let main()... into main.ml when i now compile test.mli followed by test.ml, i get error messages like: The implementation test.ml does not match the interface test.cmi: The field `#test_type' is required but not provided The field `test_type' is required but not provided So what am i doing wrong? thank you -> Heiko Irrgang ------------------- 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