Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset
Comments Off

ML: Trouver les nombres pairs d’une liste

fun exemple_tag([])=[]
  | exemple_tag(x::list)  =
    let 
       fun is_odd(y:int)=
	   y mod 2=0
	(*val new_list=exemple_tag(list)*)
   in
       case is_odd(x) of
	   false => exemple_tag(list)
	  |true  =>case exemple_tag(list) of
		       []=> x::[]
		    | y => (x::y)
end
----------------------------------------------------------------------------