Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /tests/trunk/bugs/tests.obsolete/bug34.2.sml
ViewVC logotype

View of /tests/trunk/bugs/tests.obsolete/bug34.2.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2460 - (download) (annotate)
Sat Apr 28 20:18:10 2007 UTC (12 years, 3 months ago) by gkuan
File size: 598 byte(s)
(* bug34.2.sml *)

structure foo =
struct

local
  exception Sort
in
fun sort (op > : ('x * 'x -> bool))
   = let fun select(min, best, hd::tl) = select(min,
					  if best > min
					   then if best > hd andalso hd > min
						 then hd else best
					   else hd,
					  tl)
	   | select(min, best, nil) = best;
	 fun lowest(best, hd::tl) = lowest( (if hd>best then best else hd), tl)
	   | lowest(best, nil) = best;
	 fun s (l as (hd::tl), min) = min
	   | s _ = raise Sort
      in fn (l as (hd::tl)) => let val v = lowest(hd,tl) in v :: s(l, v) end
	  | nil => nil
     end
end (* local *)

end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0