From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 1EFA2BBAF for ; Fri, 8 Aug 2008 08:13:17 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au8AAMyAm0jUGypBmWdsb2JhbACRPgEBAQEBCAUGCREDmW0 X-IronPort-AV: E=Sophos;i="4.31,325,1215381600"; d="scan'208";a="15818158" Received: from smtp8-g19.free.fr ([212.27.42.65]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Aug 2008 08:13:16 +0200 Received: from smtp8-g19.free.fr (localhost [127.0.0.1]) by smtp8-g19.free.fr (Postfix) with ESMTP id 37ABD32A84C; Fri, 8 Aug 2008 08:13:16 +0200 (CEST) Received: from [192.168.0.6] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by smtp8-g19.free.fr (Postfix) with ESMTP id 0A9C032A83D; Fri, 8 Aug 2008 08:13:15 +0200 (CEST) Message-ID: <489BE3F8.7070207@frisch.fr> Date: Fri, 08 Aug 2008 08:13:12 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Jake Donham Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] linking the same module more than once References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 compiler:01 dynlink:01 ocaml:01 ocamlopt:01 -pack:01 dynlink:01 4231:98 wrote:01 exception:01 caml-list:01 alain:01 alain:01 modules:02 Jake Donham wrote: > There is no trouble linking a module more than once, but different > parts of the code can wind up linked to different instances of the > module, leading to the confusing behavior that exception handling > seems not to work (and generally that things you think are equal are > not). You should really avoid linking two modules with the same name. This can lead to all kind of errors and the compiler will not always catch you if they have the same signature. You can even break type safety by linking two modules with the same name and signature but with different implementations: - without Dynlink: http://caml.inria.fr/mantis/view.php?id=4231 (quite simple with ocaml; more difficult with ocamlopt, but still possible with -pack) - with Dynlink: http://caml.inria.fr/mantis/view.php?id=4229 -- Alain