From: "Chris King" <colanderman@gmail.com>
To: "Jonathan Bryant" <jtbryant@valdosta.edu>
Cc: "Jon Harrop" <jon@ffconsultancy.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Execution time of class versus record
Date: Mon, 25 Jun 2007 20:15:29 -0400 [thread overview]
Message-ID: <875c7e070706251715x61893212k62c9a15ce8e08989@mail.gmail.com> (raw)
In-Reply-To: <01BF21CB-3772-4642-8EA7-C18DA5A8F712@valdosta.edu>
On 6/25/07, Jonathan Bryant <jtbryant@valdosta.edu> wrote:
> I've always been a little curious about this. Is performance the
> _only_ reason for this distinction? Construction and pattern
> matching on the two are identical, and AFAIK neither doesn't allow
> partial application.
Using the tupled form, you can pattern-match the tuple as a whole. E.g.
# type t = A of (int * int);;
# match A (1,2) with A x -> x;;
int * int = (1, 2)
This isn't allowed with the non-tupled form. Same goes for
construction. (This is where the non-tupled form can actually cost
you, if you need to pass around its arguments as a tuple somewhere.)
- Chris
next prev parent reply other threads:[~2007-06-26 0:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-24 15:14 tmp123
2007-06-24 15:29 ` [Caml-list] " Jon Harrop
2007-06-24 15:48 ` Till Varoquaux
2007-06-24 16:06 ` Arnaud Spiwack
2007-06-24 18:18 ` skaller
2007-06-24 18:29 ` Gerd Stolpmann
2007-06-24 18:51 ` Arnaud Spiwack
2007-06-24 19:11 ` Chris King
2007-06-25 3:25 ` Jon Harrop
2007-06-25 11:16 ` Arnaud Spiwack
2007-06-25 12:07 ` Jon Harrop
2007-06-25 23:59 ` Jonathan Bryant
2007-06-26 0:15 ` Chris King [this message]
2007-06-26 6:53 ` Loup Vaillant
2007-06-26 7:02 ` Jon Harrop
2007-06-26 17:07 ` Loup Vaillant
2007-06-28 1:13 ` Christian Stork
2007-06-26 13:35 ` Sam Steingold
2007-06-26 16:29 ` [Caml-list] " Quôc Peyrot
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=875c7e070706251715x61893212k62c9a15ce8e08989@mail.gmail.com \
--to=colanderman@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=jon@ffconsultancy.com \
--cc=jtbryant@valdosta.edu \
/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