caml-list - the Caml user's mailing list
 help / Atom feed
From: Romain Bardou <romain@cryptosense.com>
To: Alain Frisch <alain.frisch@lexifi.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Newbie comment on constructor syntax
Date: Tue, 10 Nov 2015 14:41:19 +0100
Message-ID: <5641F3FF.2050308@cryptosense.com> (raw)
In-Reply-To: <5641EE81.2040409@lexifi.com>

On 10/11/2015 14:17, Alain Frisch wrote:
> On 10/11/2015 11:55, Romain Bardou wrote:
>> That #C would mean something different for the definitions is an issue
>> with the syntax and the semantics of constructor definitions I believe,
>> which is already rather confusing :)
>
> This confusion is precisely the one I'm trying to address with GPR#284.
>   At the expression and pattern level, things are pretty clear:
> constructors take 0 or 1 argument.  The only subtlety that remains is
> with the type inclusion relation, but this is not at the expression
> level.  Let's not re-introduce more confusion by making it observable
> again at the expression level whether the constructor was defined as "A
> of (int * int)" or "A of int * int".

I see: you do not just propose to have a way to extract a tuple from a 
multi-argument constructor. What you propose is to make all constructors 
have only 0 or 1 argument (which may be a tuple). Under the hood, the 
tuple case is flattened to avoid an allocation, but the programmer does 
not have to know anymore (unless he uses Obj I guess).

That would be a great change I believe.

-- 
Romain

  reply index

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06  9:33 Soegtrop, Michael
2015-11-06 10:04 ` Nicolas Ojeda Bar
2015-11-06 10:31 ` Francois Berenger
2015-11-06 12:20   ` Soegtrop, Michael
2015-11-06 12:34     ` Gabriel Scherer
2015-11-06 13:09       ` Soegtrop, Michael
2015-11-06 14:10         ` Ashish Agarwal
2015-11-06 15:19           ` Soegtrop, Michael
2015-11-06 15:22             ` Ashish Agarwal
2015-11-21 17:24       ` [Caml-list] Notation for currying Hendrik Boom
2015-11-21 17:42         ` Gabriel Scherer
2015-11-21 18:06         ` David Rajchenbach-Teller
2015-11-21 18:56           ` Gabriel Scherer
2015-11-06 12:29 ` [Caml-list] Newbie comment on constructor syntax Jonas Jensen
2015-11-06 12:46   ` Soegtrop, Michael
2015-11-06 12:55     ` Gabriel Scherer
2015-11-08 21:17 ` Florian Weimer
2015-11-08 22:51   ` Norman Hardy
2015-11-09  6:27     ` Florian Weimer
2015-11-09 13:27       ` Stefan Monnier
2015-11-09  8:10     ` Soegtrop, Michael
2015-11-09 10:00       ` Hendrik Boom
2015-11-09 10:17       ` Alain Frisch
2015-11-09 10:35         ` Andreas Rossberg
2015-11-09 12:28           ` Alain Frisch
2015-11-09 17:33           ` Alain Frisch
2015-11-09 18:09             ` Gabriel Scherer
2015-11-09 18:16               ` Andreas Rossberg
2015-11-09 21:12                 ` Gabriel Scherer
2015-11-09 22:06                   ` Alain Frisch
2015-11-09 22:27                   ` Andreas Rossberg
2015-11-09 22:57                     ` Jeremy Yallop
2015-11-10  0:11                   ` Hendrik Boom
2015-11-10  8:27                   ` Soegtrop, Michael
2015-11-10 10:26                     ` Romain Bardou
2015-11-10 10:44                       ` Alain Frisch
2015-11-10 10:55                         ` Romain Bardou
2015-11-10 13:17                           ` Alain Frisch
2015-11-10 13:41                             ` Romain Bardou [this message]
2015-11-10 14:01                               ` Alain Frisch
2015-11-13 15:36                           ` Romain Bardou
2015-11-10 11:17                         ` Soegtrop, Michael
2015-11-10 14:11                     ` Hendrik Boom
2015-11-10 14:40                       ` immanuel litzroth
2015-11-10 15:30                       ` Soegtrop, Michael
2015-11-10 17:28                         ` Gerd Stolpmann
2015-11-09 20:32               ` Alain Frisch

Reply instructions:

You may reply publically 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=5641F3FF.2050308@cryptosense.com \
    --to=romain@cryptosense.com \
    --cc=alain.frisch@lexifi.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

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox