From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 B8649BB83 for ; Mon, 3 Jul 2006 15:19:46 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k63DJlJA030048 for ; Mon, 3 Jul 2006 15:19:47 +0200 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 PAA31639 for ; Mon, 3 Jul 2006 15:19:46 +0200 (MET DST) Received: from dorado.vub.ac.be (dorado.vub.ac.be [134.184.129.10]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k63DJkH8024836 for ; Mon, 3 Jul 2006 15:19:46 +0200 Received: from mach.vub.ac.be (maxi.vub.ac.be [134.184.129.8]) by dorado.vub.ac.be (Postfix) with ESMTP id 57E5362 for ; Mon, 3 Jul 2006 15:19:39 +0200 (CEST) Received: by mach.vub.ac.be (Postfix, from userid 21099) id 3EDAD8D09; Mon, 3 Jul 2006 15:19:39 +0200 (CEST) Received: from mail.etro.vub.ac.be (ftp.arc.vub.ac.be [134.184.2.1]) by mach.vub.ac.be (Postfix) with ESMTP id C6BDA8D05 for ; Mon, 3 Jul 2006 15:19:38 +0200 (CEST) Received: from [10.0.4.37] (helo=ssel.vub.ac.be) by smtp.etro.vub.ac.be with esmtp (Exim 4.43) id 1FxOKw-0000ib-MW for caml-list@inria.fr; Mon, 03 Jul 2006 15:19:38 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by ssel.vub.ac.be (Postfix) with ESMTP id 987C1246882D for ; Mon, 3 Jul 2006 15:19:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at example.com Received: from ssel.vub.ac.be ([127.0.0.1]) by localhost (ssel.vub.ac.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bHtByPXeqPlP for ; Mon, 3 Jul 2006 15:19:37 +0200 (CEST) Received: from [10.0.4.145] (unknown [10.0.4.145]) by ssel.vub.ac.be (Postfix) with ESMTP id 3FBBB246882C for ; Mon, 3 Jul 2006 15:19:37 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: <069A1F65-E50C-4363-9CCA-C6CC9A453D09@vub.ac.be> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list From: Bruno De Fraine Subject: Type from local module would escape its scope? Date: Mon, 3 Jul 2006 15:19:35 +0200 X-Mailer: Apple Mail (2.752.2) X-Miltered: at concorde with ID 44A91973.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44A91972.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 foo:01 sig:01 val:01 foo:01 struct:01 struct:01 caml-list:01 constructor:01 expression:01 argument:01 int:01 int:01 modules:01 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hello list, I don't quite understand this behavior regarding local modules (in OCaml 3.09.2): The following is accepted: module type FOO = sig type t val value : t end ;; let foo () = let module Foo : FOO = struct type t = int let value = 1 end in ignore Foo.value ;; While the following is rejected: let foo (ignore: 'a -> unit) = let module Foo : FOO = struct type t = int let value = 1 end in ignore Foo.value ;; With an error on the expression "Foo.value" stating that "The type constructor Foo.t would escape its scope". Reading about the typical case for this error message in http://caml.inria.fr/pub/ml-archives/ caml-list/2002/10/0cf087feab3ef8dc5ccba5a8592472fb.en.html didn't really help me. Why does it make a difference whether ignore is an argument? Thanks, Bruno