caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Don Syme" <dsyme@microsoft.com>
To: "John Max Skaller" <skaller@ozemail.com.au>
Cc: <caml-list@inria.fr>
Subject: RE: [Caml-list] Record pattern matching
Date: Thu, 10 May 2001 11:43:30 -0700	[thread overview]
Message-ID: <0C682B70CE37BC4EADED9D375809768A02DB1FEF@red-msg-04.redmond.corp.microsoft.com> (raw)

> > I guess this is considered a feature, but I just wanted to report
that
> > in my current situation I actually find it unhelpful. 
> 
> 	You'd rather be forced to code something like:
> 
> 	function { a=a; b=_ } -> a;;
> 
> where all the fields have to be named, but some of them can 
> be specified as ignored?

I guess the point is that I don't use record pattern matching much, and
where I do I don't want partial matches.  Or at least I have a cases
where enforcing full matching would catch more bugs.  For example, if
I'm writing marshalling code for the record by hand I want the type
system to tell me if I have forgotten to marshal a field.

> There is a sense in which
> 
> 	record.a
> 
> is just a shorthand for
> 
> 	match record with { a=value } -> value
> 
> which means that you might argue that the notation 
> 
> 	record.a
> 
> should be completed by naming every field too :-)

You could argue that, but I wouldn't....

Don
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-05-10 18:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-10 18:43 Don Syme [this message]
2001-05-11  8:00 ` Andreas Rossberg
2001-05-11  9:04   ` John Max Skaller
2001-05-12 17:11   ` Brian Rogoff
  -- strict thread matches above, loose matches on Subject: below --
2001-05-07 15:33 Don Syme
2001-05-07 18:37 ` John Max Skaller

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=0C682B70CE37BC4EADED9D375809768A02DB1FEF@red-msg-04.redmond.corp.microsoft.com \
    --to=dsyme@microsoft.com \
    --cc=caml-list@inria.fr \
    --cc=skaller@ozemail.com.au \
    /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).