From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 1F57881792 for ; Wed, 3 Jul 2013 12:56:42 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.171 as permitted sender) identity=helo; client-ip=212.227.126.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicBABcD1FHU436rk2dsb2JhbABaDoMtrGWBdpIbgQAWDgEBAQEHCwsJFAMlgiMBAQQBJxM0CzMNQhsJEgYTCQmHawMJCgixfgMKiFIWiSuDO4JDJgeDbQOOXoQFgn+DEYp3h3hA X-IPAS-Result: AicBABcD1FHU436rk2dsb2JhbABaDoMtrGWBdpIbgQAWDgEBAQEHCwsJFAMlgiMBAQQBJxM0CzMNQhsJEgYTCQmHawMJCgixfgMKiFIWiSuDO4JDJgeDbQOOXoQFgn+DEYp3h3hA X-IronPort-AV: E=Sophos;i="4.87,987,1363129200"; d="scan'208";a="19855029" Received: from moutng.kundenserver.de ([212.227.126.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 03 Jul 2013 12:56:14 +0200 Received: from office1.lan.sumadev.de (dslb-084-059-065-255.pools.arcor-ip.net [84.59.65.255]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MWhTP-1UkHi13ExH-00XwFW; Wed, 03 Jul 2013 12:56:07 +0200 Received: from samsung (546BF816.cm-12-4d.dynamic.ziggo.nl [84.107.248.22]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 414ADC00D0; Wed, 3 Jul 2013 12:56:06 +0200 (CEST) Date: Wed, 03 Jul 2013 12:56:08 +0200 From: Gerd Stolpmann To: Jacques Garrigue Cc: ygrek , caml-list@inria.fr In-Reply-To: <16D5DC66-9420-4B6F-B7CF-DF16161D2A6A@math.nagoya-u.ac.jp> (from garrigue@math.nagoya-u.ac.jp on Wed Jul 3 07:09:49 2013) X-Mailer: Balsa 2.4.11 Message-Id: <1372848968.3769.6@samsung> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Provags-ID: V02:K0:+fjYdKRuwzxU+35MyFksny26+wcm2qPiP6cD6lCL/bY tgA+il4r1lZynV1uoJbZnBy1LEUtP5EJ+uU8R1athAkMNw28vF l/8D3fioz8Gmyen/hfs4Ma+bO/ACJIjnGeTvpuzM4jcjY2vcCY TDGoV8TKWb7cmA75/T1VGIKzoBBj164IDB0hnUB8AoMOdUE1tt zAwum914lgMrowE7qwH03Im2GxBf30JS5heVo6Dtfza4SZJNEc UtQZMRKvCr0H5f731W5xi2DZoeRGK8XQm5JRI5ZFPoAP01nbc4 1TA/Y2u7AQmmJ6/Rp6JsMwP4myPWz5kqduPSWsFy77NyNrovMn DsJSCwfJ2Rk9ttm6LqeE= Subject: AW: [Caml-list] module alias inside class Am 03.07.2013 07:09:49 schrieb(en) Jacques Garrigue: > On 2013/07/03, at 0:09, ygrek wrote: >=20 > > Dear list, > > > > Just a short question tonight, why is the following code rejected? > > > > class z =3D let module A =3D String in object end;; > > > > Is there some deep reason or it was simply overlooked? >=20 >=20 > This would be very nice to able to do that. > Unfortunately, the typing of classes is a rather complex process, > which seems difficult to integrate with local module definitions, > except maybe in a very restrictive way. > There are also deep questions, such as what to do in presence > of inheritance. I guess the main problem is that types from A wouldn't be allowed to=20=20 appear in class types (type escapes definition scope) - unless the=20=20 notion of class types were extended so that such modules are bound=20=20 (e.g. class type z =3D object method foo : A.t end with module A :=20=20 TYPE_OF_A). But that mixes classes with modules conceptually (well, not=20= =20 that we have that already). Just trying: # class x =3D let s =3D (module String : Set.OrderedType) in object method compare =3D let module S =3D (val s) in S.compare end;; Error: This expression has type S.t -> S.t -> int but an expression was expected of type S.t -> S.t -> int The type constructor S.t would escape its scope Gerd >=20 > On the other hand, "let open" would be much easier to add. > Jacques Garrigue >=20 > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >=20 >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------=