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 MAA18045; Sat, 22 Mar 2003 12:53:25 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA17333 for caml-list@pauillac.inria.fr; Sat, 22 Mar 2003 12:53:24 +0100 (MET) 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 AAA06855 for ; Fri, 21 Mar 2003 00:32:36 +0100 (MET) Received: from innsmouth.crhc.uiuc.edu (innsmouth.crhc.uiuc.edu [130.126.141.158]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2KNWZX18575 for ; Fri, 21 Mar 2003 00:32:35 +0100 (MET) Received: (from jjcook@localhost) by innsmouth.crhc.uiuc.edu (8.11.6/8.11.6) id h2KNWYw18053 for caml-list@inria.fr; Thu, 20 Mar 2003 17:32:34 -0600 Date: Thu, 20 Mar 2003 17:32:34 -0600 From: "Jeffrey J. Cook" To: caml-list@inria.fr Subject: [Caml-list] code duplication when abstracting using explicit signatures Message-ID: <20030320233234.GA17684@crhc.uiuc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Spam: no; 0.00; mli:01 ocamlopt:01 ocamlc:01 cmo:01 ocaml:01 signatures:02 linking:02 modules:02 explicit:03 argument:03 exported:03 types:03 undefined:04 cook:04 functions:05 X-Spam: no; 0.00; mli:01 ocamlopt:01 ocamlc:01 cmo:01 ocaml:01 signatures:02 linking:02 modules:02 explicit:03 argument:03 exported:03 types:03 undefined:04 cook:04 functions:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'm trying to avoid code duplication, but have a very simple case where it seems inescapable utilitizing only the functionality of the ocaml tools. In example.mli, I declare several large types, in which I want the full contents of the types to be visible to other modules. How do I avoid duplicating those full definitions in example.ml? I've tried using "include Example" at the beginning of example.ml, which ocamlopt has no argument with, but ocamlc gives: Error while linking example.cmo: Reference to undefined global `Example' I can't simply skip the .mli, as there are functions in example.ml that I don't want exported; not to meantion the clean-ness of seperation .mli's provide. Any suggestions? Thanks. -- Jeffrey J. Cook Graduate Student, Electrical Engineering University of Illinois at Urbana-Champaign jjcook@uiuc.edu ------------------- 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