Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Vasili Galchin <vasiliocaml@yahoo.com>
To: caml-list@inria.fr
Subject: [Caml-list] Patterns in ML vs OCaml ...
Date: Sun, 24 Oct 2004 10:35:52 -0700 (PDT)	[thread overview]
Message-ID: <20041024173552.96205.qmail@web53002.mail.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]


Hello,
 
    I'm sorry this is a very elementary question (but I am pulling my hair out). With a function written in ML:
 
fun filter_list P []       = [] |
    filter_list P (h :: t) = let val ft = filter_list P t
                             in if P h then (h :: ft)
                                else ft
                             end;
 
OR
 
fun member (e, nil) = false |
    member (e , (h :: t)) = if (e=h) then true
                                     else member (e, t) ;


What is the preferred way to write in OCaml using pattern matching on parms??
 
Regards, Vasili


		
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

[-- Attachment #2: Type: text/html, Size: 1707 bytes --]

             reply	other threads:[~2004-10-24 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-24 17:35 Vasili Galchin [this message]
2004-10-24 18:41 ` Brian Hurt

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=20041024173552.96205.qmail@web53002.mail.yahoo.com \
    --to=vasiliocaml@yahoo.com \
    --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