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 QAA17805; Fri, 23 May 2003 16:21:39 +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 QAA17775 for ; Fri, 23 May 2003 16:21:38 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4NEL7H05357; Fri, 23 May 2003 16:21:07 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA17803; Fri, 23 May 2003 16:21:06 +0200 (MET DST) Date: Fri, 23 May 2003 16:21:06 +0200 From: Xavier Leroy To: g.o.d@zefix.tv Cc: caml-list@inria.fr Subject: Re: [Caml-list] newbie problem with splitting code into files Message-ID: <20030523162106.A17477@pauillac.inria.fr> References: <20030523124814.GD5371@sfear.sc-networks.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20030523124814.GD5371@sfear.sc-networks.de>; from g.o.d@zefix.tv on Fri, May 23, 2003 at 02:48:14PM +0200 X-Spam: no; 0.00; caml-list:01 newbie:01 mli:01 val:01 printf:01 mutable:01 int:01 object:03 let:04 seems:05 type:07 problem:07 split:09 leroy:12 xavier:13 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > i want to split code like for example the following into > several files: The following seems to do what you want: ----------- file test.mli ------------- class type test_type = object val mutable x:int method get_x:int end class test : test_type ----------- file test.ml -------------- 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 ----------- file main.ml -------------- open Test open Printf let main() = let t=new test in printf "X: %d\n" t#get_x;; let _ = main() --------------------------------------- Hope this helps, - Xavier Leroy ------------------- 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