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 VAA21283; Sun, 3 Feb 2002 21:44:04 +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 VAA19835 for ; Sun, 3 Feb 2002 21:44:03 +0100 (MET) Received: from relay-3v.club-internet.fr (relay-3v.club-internet.fr [194.158.96.114]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g13Ki2v02404 for ; Sun, 3 Feb 2002 21:44:03 +0100 (MET) Received: from warp (lns01v-7-43.w.club-internet.fr [213.44.246.43]) by relay-3v.club-internet.fr (Postfix) with SMTP id 4950E1705 for ; Sun, 3 Feb 2002 21:44:01 +0100 (CET) Message-ID: <000301c1acf2$eef10300$9b00a8c0@warp> From: "Warp" To: "OCaml" Subject: [Caml-list] Strange behavior Date: Sun, 3 Feb 2002 12:14:13 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Here's a very short sample of a very strange behavior with CMA. I don't know if it's a "bug" but it looks like... I got a CMA ( let's call it Main ) : ---- Main.ml ----- include Types include Funcs ---- Types.ml ----- type ta type tb = ta external get_ta : unit -> ta = "get" ---- Funcs.ml ---- open Types external f : tb -> unit = "function" And a test program : ---- Test.ml ----- open Main f (get_ta()) Let's compile : ocamlc -c types.ml ocamlc -c funcs.ml ocamlc -a main.ml -o main.cma ocamlc -c test.ml It works ! Now, we doesn't need anymore the CMI / CMO of Types and Funcs ( because all defs are included in main.cma+cmi ), so let's delete theses files : rm types.c* rm funcs.c* ... and try to compile Test : ocamlc -c test.ml This expression has type Main.ta = Types.ta but is here used with Types.tb In fact, we need to keep the Types.cmi to compile, breaking the CMA rules. I think this behavior comes from the "include" directive, which is conservative with type paths. Warp ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr