caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* The kth element
@ 2007-01-15 21:52 Lloyd Moore
  2007-01-15 22:25 ` [Caml-list] " Jonathan Bryant
  0 siblings, 1 reply; 2+ messages in thread
From: Lloyd Moore @ 2007-01-15 21:52 UTC (permalink / raw)
  To: caml-list

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

If I understood the question correctly posed by Dr Jon Harrop...

 let smallest lst = let rec sml lst v =
 match lst with
   [] -> v
 | h::t ->
     match t with
         h::t -> if h < (List.hd t) then sml t h else sml t v
     | _ -> v
  in sml lst (List.hd lst) ;;

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

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

end of thread, other threads:[~2007-01-15 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-15 21:52 The kth element Lloyd Moore
2007-01-15 22:25 ` [Caml-list] " Jonathan Bryant

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).