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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D1490BB83 for ; Mon, 3 Jul 2006 15:23:16 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k63DNH6T025660 for ; Mon, 3 Jul 2006 15:23:17 +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 PAA31655 for ; Mon, 3 Jul 2006 15:23:16 +0200 (MET DST) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.194]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k63DNGBT025652 for ; Mon, 3 Jul 2006 15:23:16 +0200 Received: by nz-out-0102.google.com with SMTP id m7so550731nzf for ; Mon, 03 Jul 2006 06:23:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=e+m/QaPaVHUaxwZyZPy75CiWqjbsFsk1P5QVo0IkVYRQf9I/huy1FxJPqPPU1H5A8SMRKYcUtmfvlJRicH6XoKj1W9SQAiwBTinIz2TdZsv9nJmgJpgEuAwbe/9to7jZ44VCkGK8ssBRUtu+PHhQNf//1PBMkk3vpK19iTb3Up8= Received: by 10.36.140.3 with SMTP id n3mr3614952nzd; Mon, 03 Jul 2006 06:23:14 -0700 (PDT) Received: by 10.36.101.10 with HTTP; Mon, 3 Jul 2006 06:23:14 -0700 (PDT) Message-ID: Date: Tue, 4 Jul 2006 01:23:14 +1200 From: "Jonathan Roewen" To: "Bruno De Fraine" Subject: Re: [Caml-list] Type from local module would escape its scope? Cc: caml-list In-Reply-To: <069A1F65-E50C-4363-9CCA-C6CC9A453D09@vub.ac.be> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <069A1F65-E50C-4363-9CCA-C6CC9A453D09@vub.ac.be> X-j-chkmail-Score: MSGID : 44A91A44.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44A91A45.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44A91A44.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; foo:01 sig:01 val:01 foo:01 struct:01 struct:01 caml-list:01 caml-list:01 constructor:01 expression:01 argument:01 int:01 int:01 caml:02 scope:03 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=RCVD_BY_IP autolearn=disabled version=3.0.3 > 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? Because the type isn't visible (ignore returns unit, not Foo.t). Jonathan