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=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 6DB4BBC0A for ; Tue, 15 May 2007 09:12:35 +0200 (CEST) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4F7CZXS009858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 15 May 2007 09:12:35 +0200 Received: from smtp.lri.fr (serveur3-5 [129.175.3.5]) by ext.lri.fr (Postfix) with ESMTP id B5895202089; Tue, 15 May 2007 09:12:34 +0200 (CEST) Received: from serveur9-10.lri.fr (serveur9-10 [129.175.9.10]) by smtp.lri.fr (Postfix) with ESMTP id 55987CED98; Tue, 15 May 2007 09:12:34 +0200 (CEST) Date: Tue, 15 May 2007 09:12:34 +0200 (CEST) From: Julien Signoles To: caml-list@yquem.inria.fr Cc: Julien Signoles Subject: include, functor and side-effect Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at lri.fr X-Miltered: at concorde with ID 46495D63.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; signoles:01 signoles:01 lri:01 functor:01 ocamlc:01 ocamlopt:01 sig:01 struct:01 endline:01 struct:01 sig:01 endline:01 bug:01 lri:01 behaviour:01 Hello, The following code outputs "toto" (both with ocamlc and ocamlopt, test with 3.09.2): that's the normal behaviour of the "include" statement. ========== module F(X:sig end) = struct let x = print_endline "toto" end module G = struct include F(struct end) end ========== But if you change "let x = ..." by "let () = ..." as follow, there is no more output: ========== module F(X:sig end) = struct let () = print_endline "toto" end module G = struct include F(struct end) end ========== Do you consider this behaviour as a bug or as the normal behaviour of an "include" statement? Note that if you substitute "include" by "module M = ", the code still outputs "toto". Julien Signoles -- mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles "In theory, practice and theory are the same, but in practice they are different" (Larry McVoy)