Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] Patterns in ML vs OCaml ...
@ 2004-10-24 17:35 Vasili Galchin
  2004-10-24 18:41 ` Brian Hurt
  0 siblings, 1 reply; 2+ messages in thread
From: Vasili Galchin @ 2004-10-24 17:35 UTC (permalink / raw)
  To: caml-list

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-24 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-24 17:35 [Caml-list] Patterns in ML vs OCaml Vasili Galchin
2004-10-24 18:41 ` Brian Hurt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox