From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q1MGevNk008236 for ; Wed, 22 Feb 2012 17:40:57 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMCANYZRU/RVdW2kGdsb2JhbABDhSibZ5EtCCIBAQEBCQkNGwQjgXMBAQEEEgIPHQEtCwEDDAEFBQsNAgIJHQICIQESAQUBChIGExIJB4domkUKiyaDPYUuiTICBQuBJIdQWIMLASAPBAUKAwMHAwIFAh0FAwKFFkoGEAoIAwSCF4EWBIhPjGmHF1KDLoMWPYFTgk6BNQk X-IronPort-AV: E=Sophos;i="4.73,464,1325458800"; d="scan'208";a="132470217" Received: from mail-yx0-f182.google.com ([209.85.213.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 22 Feb 2012 17:40:51 +0100 Received: by yenl12 with SMTP id l12so198618yen.27 for ; Wed, 22 Feb 2012 08:40:50 -0800 (PST) Received-SPF: pass (google.com: domain of till.varoquaux@gmail.com designates 10.60.26.166 as permitted sender) client-ip=10.60.26.166; Authentication-Results: mr.google.com; spf=pass (google.com: domain of till.varoquaux@gmail.com designates 10.60.26.166 as permitted sender) smtp.mail=till.varoquaux@gmail.com; dkim=pass header.i=till.varoquaux@gmail.com Received: from mr.google.com ([10.60.26.166]) by 10.60.26.166 with SMTP id m6mr14392420oeg.45.1329928850779 (num_hops = 1); Wed, 22 Feb 2012 08:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Fbpk+LRRkwOla369aUB36Oa05EzSrjSOAs7bsCf2MvQ=; b=xh6xv6mddOf8/IVfYxi5caJNEFOcUAWCni6ECBTQF4wJfpCk+oLCsxuaiWrFxcXmAm 8YlZFGTPh0vla0XTjBNHDkYOJemi2n5VhZ2Pahfxamo8tlR1l9Tp0MCuu2E66TZzQJ/c JWJh9agFQF87jm3L/VsSShaPm6F/EGU8URsIc= MIME-Version: 1.0 Received: by 10.60.26.166 with SMTP id m6mr12324304oeg.45.1329928850580; Wed, 22 Feb 2012 08:40:50 -0800 (PST) Sender: till.varoquaux@gmail.com Received: by 10.182.66.233 with HTTP; Wed, 22 Feb 2012 08:40:50 -0800 (PST) In-Reply-To: References: Date: Wed, 22 Feb 2012 11:40:50 -0500 X-Google-Sender-Auth: c7CLXgh_YOoSMGSVAJfWIiLnPC4 Message-ID: From: Till Varoquaux To: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Cc: "Hezekiah M. Carty" , Ashish Agarwal , Caml List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q1MGevNk008236 X-Validation-by: till@pps.jussieu.fr Subject: Re: [Caml-list] Re: "module type of" on sub-module of functor result 2012/2/22 Milan Stanojević d > On Tue, Feb 21, 2012 at 3:32 PM, Hezekiah M. Carty wrote: >> On Tue, Feb 21, 2012 at 2:37 PM, Ashish Agarwal wrote: >>> I must've accidentally deleted part of my email before hitting send. The >>> point was to make the first code sample compile after removing the commented >>> line. But that is not allowed; I get a syntax error: >>> >>> $ ocamlfind ocamlc -c -package batteries a.ml >>> File "a.ml", line 6, characters 38-39: >>> Error: Syntax error: 'end' expected >>> File "a.ml", line 4, characters 16-19: >>> Error: This 'sig' might be unmatched >>> >>> I'm wondering if there is a better solution than my second code sample. >>> > > I would consider this a bug. I think than any module expression than > can be used with "include" should be usable with "include module type > of" > > -- > Caml-list mailing list.  Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > Milan is right: the language grammar does say that both [include] and [module type of] should work on module_expr. However, based upon the manual(*), [A(B)] and [A.B] are syntacticly valid module_expr's but [A(B).C] isn't. Is this because of an inherent limitation in the module system? [*]http://caml.inria.fr/pub/docs/manual-ocaml/manual019.html#module-expr