Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. fun even(n) = if n = 0 then true else
  2. if n = 1 then false else even(n-2);
  3.  
  4. fun append(x,y) = if null(x) then y else
  5. hd(x) :: append (tl(x),y);
  6.  
  7. fun f(x) = if null(x) then [] else
  8. if even(hd(x)) then hd(x) :: f(tl(x))
  9. else hd(x) ::f(tl(x));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement