From: Jeff Shaw <shawjef3@msu.edu>
To: caml-list@inria.fr
Subject: Re: Pattern-matching destructors ?
Date: Tue, 16 Oct 2007 12:16:18 -0400 [thread overview]
Message-ID: <4714E3D2.4080404@msu.edu> (raw)
If you're matching against a record, you can omit the values you don't
care about. For instance:
type test = {a : int; b : int}
let testfun = function {a=x; b= y} when x=y -> "same" | {a=x} -> ("a is
" ^ string_of_int x);;
I'm not sure if this helps you but it's the first thing I thought off.
next reply other threads:[~2007-10-16 16:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-16 16:16 Jeff Shaw [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-16 15:20 David Teller
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=4714E3D2.4080404@msu.edu \
--to=shawjef3@msu.edu \
--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