English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Renaming structures during inclusions?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-05-12 (20:02)
From: Aleksey Nogin <nogin@c...>
Subject: Re: [Caml-list] Renaming structures during inclusions?
On 11.05.2005 08:44, Markus Mottl wrote:

> The only solution that seems to make sense and does not impose
> excessive work on the user is, IMHO, to provide for a facility to
> rename types and modules, e.g. maybe something like:
> ----------------------------------------------
> module M = struct
>   include M1
>     with type t as m1_t
>     with module Std as M1Std
>   include M2
>     with type t as m2_t
>     with module Std as M2Std
>   module Std = struct
>     include M1Std
>     include M2Std
>   end
> end
> ----------------------------------------------

I would like to second this request. Currently, including several 
modules that share some structure is impossible and requires giving 
separate names for all the shared fields, with can be very painful. The 
"with" renaming seems simple enough and AFAICT would not break anything.

Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal)
Office: Moore 04, tel: (626) 395-2200