Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Thierry Bravier <Thierry.Bravier@dassault-aviation.fr>
To: caml-list <caml-list@inria.fr>
Subject: Re: Suggestions pour les modules
Date: Thu, 11 Mar 1999 19:27:55 +0100	[thread overview]
Message-ID: <36E80B2A.C38CA1D2@dassault-aviation.fr> (raw)

Dear ocamlers,

Christophe Raffalli wrote:

> Voici quelques suggestions qui me paraissent utiles pour
> ameliorer la puissance du systeme de modules:

>   3) Le include devrait aussi marcher pour les structures afin d'avoir

>  aussi de l'heritage sur les modules (les contraintes n'ont pas de
sens
> dans ce cas, il s'agit donc d'un simple sucre syntaxique).
>   Exemple: il est penible d'ecrire
>  module T = struct
>   let x = ...
>    let y = ...
>  end
>  module T' =
>    let x = x.T
>    let y = y.T
>    let z = ...
>  end
>  au lieu de
>  module T' =
>    include T
>    let z = ...
>  end

I have already encountered this problem, and I also feel there is a need
for including structs.

>  4) Moins important : on devrait pouvoir passer une valeur ou un type
a
>  un functor sans l'encapsuler a la main dans un module

I once had to write:

module type UNIT = sig end

module Make_Foo (Unit : UNIT) = struct ... end

module Foo = Make_Foo (struct end)

which looks really silly, it would become

module Foo = Make_Foo ()

would not it ?

>  5) Encore moins important: Pouvoir utiliser les symboles infix d'un
>  module en notation infix (C'est la moindre des choses ?)
>  genre  x Q.R.+ y  ou  x +.Q.R y  pour  Q.R.(+) x y

I happen to have already suggested this useful feature (the answer was
that it would complicate parsing)

Cheers.

--
Thierry Bravier                     Dassault Aviation - DGT / DPR / DESA
78, Quai Marcel Dassault              F-92214 Saint-Cloud Cedex - France
Telephone : (33) 01 47 11 53 07          Telecopie : (33) 01 47 11 52 83
E-Mail :                     mailto:thierry.bravier@dassault-aviation.fr


Christophe Raffalli wrote:

> Voici quelques suggestions qui me paraissent utiles pour
> ameliorer la puissance du systeme de modules:

> 3) Le include devrait aussi marcher pour les structures afin d'avoir
> aussi de l'heritage sur les modules (les contraintes n'ont pas de sens
> dans ce cas, il s'agit donc d'un simple sucre syntaxique).
>
> Exemple: il est penible d'ecrire
>
> module T = struct
>   let x = ...
>   let y = ...
> end
>
> module T' =
>   let x = x.T
>   let y = y.T
>   let z = ...
> end
>
> au lieu de
>
> module T' =
>   include T
>   let z = ...
> end
>
>

I have already encountered this problem, and I also feel there is a need
for including structs.

> 4) Moins important : on devrait pouvoir passer une valeur ou un type a
> un functor sans l'encapsuler a la main dans un module
>
> Ainsi au lieu d'ecrire
>
> module type Un_Int =
>   sig
>     val n : int
>   end
>
> module F = functor (N : Un_Int) -> ....
>
> on pourrait ecrire
>
> module F = functor (n : int) -> ....
>
> Il suffit d'ajouter les sucres syntaxiques suivants:
>
>   functor (type t) ->  :=  functor (T : sig type t end) ->
>     avec t = T.t dans la suite
>
>   functor (v : t) ->   :=  functor (V : sig val v : t end) ->
>     avec v = V.v dans la suite
>
> et les abbreviations similaires pour l'application et les declaration
> de types (il me semble que cette syntaxe n'est pas ambigue ?)

I once had to write:

module type UNIT = sig end

module Make_Foo (Unit : UNIT) = struct ... end

module Foo = Make_Foo (struct end)

which looks really silly, it would become

module Foo = Make_Foo ()

would not it ?

> 5) Encore moins important: Pouvoir utiliser les symboles infix d'un
> module en notation infix (C'est la moindre des choses ?)
>
> genre  x Q.R.+ y  ou  x +.Q.R y  pour  Q.R.(+) x y

I happen to have already suggested this useful feature (the answer was
that it would complicate parsing)

Cheers.

--
Thierry Bravier                     Dassault Aviation - DGT / DPR / DESA
78, Quai Marcel Dassault              F-92214 Saint-Cloud Cedex - France
Telephone : (33) 01 47 11 53 07          Telecopie : (33) 01 47 11 52 83
E-Mail :                     mailto:thierry.bravier@dassault-aviation.fr




             reply	other threads:[~1999-03-12  7:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-11 18:27 Thierry Bravier [this message]
     [not found] <199903080745.IAA23583@pauillac.inria.fr>
1999-03-08  9:27 ` Christophe Raffalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36E80B2A.C38CA1D2@dassault-aviation.fr \
    --to=thierry.bravier@dassault-aviation.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox