caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Feature request : Tuples vs. records
Date: Fri, 23 Feb 2007 01:45:55 +0000	[thread overview]
Message-ID: <200702230145.55947.jon@ffconsultancy.com> (raw)
In-Reply-To: <45DDC1CB.2090401@ens-lyon.org>

On Thursday 22 February 2007 16:16, David Teller wrote:
> I'm more concerned about having to
> * declare every record type I use -- that looks to me clumsy and Java-like
> * differenciate between records and tuples during pattern-matching

The same can be said of ordinary and polymorphic variants. You must declare 
ordinary variants. You must distinguish between the two in patterns.

Similarly, polymorphic variants (that are structurally typed and provide more 
inference) weaken the type system. The main disadvantage of this is in 
reporting errors, which become prohibitively obfuscated.

> * having to learn/teach two different implementations of what is
> essentially the same concept

Although tuples and records are both product types, I think people have cited 
several fundamental differences between them: typing, performance, robustness 
etc.

> * having to learn/teach that third meaning of operator = (the first one
> being comparison between values and the second one being its use in let
> x = ...).

You would rather teach another use of ":"?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


  parent reply	other threads:[~2007-02-23  2:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22 15:34 Frederic GAVA
2007-02-22 16:16 ` David Teller
2007-02-23  1:39   ` Jacques Garrigue
2007-02-23 13:34     ` Richard Jones
2007-02-23 13:43       ` Till Varoquaux
2007-02-23 14:14         ` Nicolas Pouillard
2007-02-23  1:45   ` Jon Harrop [this message]
2007-02-23 16:32     ` Lukasz Stafiniak
2007-02-24 13:43       ` Lukasz Stafiniak
2007-02-24 15:50         ` Brian Hurt
2007-02-24 18:14           ` skaller
  -- strict thread matches above, loose matches on Subject: below --
2007-02-22 10:25 David Teller
2007-02-22 10:42 ` [Caml-list] " Andrej Bauer
2007-02-22 12:41   ` skaller
2007-02-22 13:55     ` David Teller
2007-02-22 15:44       ` Jon Harrop
2007-02-22 19:45       ` Tom
2007-02-22 23:26         ` skaller
2007-02-22 15:28     ` Andreas Rossberg
2007-02-22 15:57       ` Till Varoquaux
     [not found]         ` <45DDC424.2020804@ens-lyon.org>
2007-02-22 16:57           ` Till Varoquaux
2007-02-22 17:19             ` brogoff

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=200702230145.55947.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --cc=caml-list@yquem.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).