From: Pixel <pixel@mandrakesoft.com>
To: caml-list@pauillac.inria.fr
Subject: [Caml-list] "Or" patterns when both matchings
Date: 28 Oct 2001 12:02:02 +0100 [thread overview]
Message-ID: <ly3d44yqmt.fsf@leia.mandrakesoft.com> (raw)
from the documentation:
The pattern pattern1 | pattern2 represents the logical ``or'' of the two
patterns pattern1 and pattern2. [...] If both matchings succeed, it is
undefined which set of bindings is selected.
is there a reason for not using the classical pattern matching rule, to make
the ordering matters? (i've been nastily beat by this :-/)
eg:
type foo = Bar | Foo of foo
let f1 = function
| Foo(a)
| a -> a
let f2 = function
| Foo(a) -> a
| a -> a
let e1 = f1 (Foo Bar) (*=> Foo Bar *)
let e2 = f2 (Foo Bar) (*=> Bar *)
thanks
--
Pixel
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next reply other threads:[~2001-10-28 11:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-28 11:02 Pixel [this message]
2001-10-29 10:37 ` Luc Maranget
2001-10-30 18:22 Manuel Fahndrich
2001-10-31 9:42 ` Luc Maranget
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=ly3d44yqmt.fsf@leia.mandrakesoft.com \
--to=pixel@mandrakesoft.com \
--cc=caml-list@pauillac.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