caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Edgar Friendly <thelema314@gmail.com>
To: Andrej.Bauer@andrej.com
Cc: Caml <caml-list@inria.fr>
Subject: Re: [Caml-list] OO programming
Date: Thu, 28 Feb 2008 10:02:05 -0600	[thread overview]
Message-ID: <47C6DAFD.6000208@gmail.com> (raw)
In-Reply-To: <47C6B774.8070308@fmf.uni-lj.si>

Andrej Bauer wrote:
> Keiko Nakata wrote:
>>>> As for extension, I'm fully satisfied. But the verbosity level is
>>>> annoying for scalability...
>>> Well, yes, that's always the problem with functors...
>>
>> Since there are some people (including me) who are interested in using
>> functors and recursive modules in the style of object-oriented
>> context, I thought that it could be useful to devise a (camlp4) syntax
>> extension which mitigates this a bit painful verbosity.
>> At the moment, I have no idea which syntax is general enough and
>> intuitive for us,
>> but as far as I understand we always follow similar encodings. 
> 
> I have three wishes related to the case when a functor accepts a
> structure that contains a single type or a single value:
> 
> 1) To be able to write
> 
>   module F(type t) = struct ...t... end
> 
> instead of
> 
>   module F(T : sig type t end) = struct ... T.t  ... end
> 
> and to write
> 
>   F(s)
> 
> instead of
> 
>   F(struct type t = s end)
> 
I wonder what use you would put this to where normal 'a polymorphism
wouldn't suffice.

> 2) Similarly for values, to be able to write
> 
>   module F(val x : t) = struct ... x ... end
> 
> instead of
> 
>   module F(T : sig val x : t end) = struct ... T.x ... end
> 
Similarly, an additional parameter on each of the contained functions
seems not too unreasonable.  I guess I can see more use for this than
#1, but a global ref inside F might also work, as long as you had a way
to set it and you had a good default.

E.


  parent reply	other threads:[~2008-02-28 16:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21  9:31 Tiphaine Turpin
2008-02-21  9:42 ` [Caml-list] " Erik de Castro Lopo
2008-02-21 13:38 ` Remi Vanicat
2008-02-24 16:33 ` [Caml-list] " Dirk Thierbach
2008-02-25  9:23   ` Tiphaine.Turpin
2008-02-25 15:48     ` Edgar Friendly
2008-02-25 16:02       ` Berke Durak
2008-02-25 20:12         ` Dirk Thierbach
2008-02-25 20:51           ` Tiphaine.Turpin
2008-02-25 23:03             ` Dirk Thierbach
2008-02-25 20:10     ` Dirk Thierbach
2008-02-25 21:49       ` Tiphaine.Turpin
2008-02-25 23:07         ` Dirk Thierbach
2008-02-29 14:22       ` Tiphaine.Turpin
2008-02-26  6:17 ` Jacques Garrigue
2008-02-26  9:36   ` Julien Signoles
2008-02-27  0:25   ` Tiphaine.Turpin
2008-02-27  1:37     ` Jacques Garrigue
2008-02-28  8:34       ` Keiko Nakata
2008-02-28 13:30         ` Andrej Bauer
2008-02-28 15:18           ` Keiko Nakata
2008-02-28 16:02           ` Edgar Friendly [this message]
2008-02-29 14:35         ` Tiphaine.Turpin
2008-02-29 15:58           ` Keiko Nakata
2008-03-03  9:40             ` Tiphaine.Turpin
2008-03-03 10:20               ` Jacques Garrigue
2008-03-03 10:30                 ` Tiphaine.Turpin
2008-03-03 15:18               ` Keiko Nakata
2008-03-03 19:25                 ` Tiphaine Turpin
2008-03-04 14:00                   ` Keiko Nakata
2008-02-27  7:40     ` Dirk Thierbach
2008-02-27 14:04       ` Tiphaine.Turpin

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=47C6DAFD.6000208@gmail.com \
    --to=thelema314@gmail.com \
    --cc=Andrej.Bauer@andrej.com \
    --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;
as well as URLs for NNTP newsgroup(s).