Advertisement
Guest User

Untitled

a guest
Jan 11th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.61 KB | None | 0 0
  1. (define existe(lambda (L P)
  2.                 (if(null? L)
  3.                    #f
  4.                    (or(P (car L))
  5.                       (existe  (cdr L) P) )
  6.                    )  ))
  7.  
  8. (define quel_que_soit(lambda (L P)
  9.                        (if(null? L)
  10.                           #f
  11.                           (and(P (car L))
  12.                               (quel_que_soit (cdr L) P)
  13.                               ))
  14.                        ))
  15.  
  16.  
  17. (define tous_egaux(lambda (L)
  18.   (not(existe  L (lambda(x) (not( = x (car L)))
  19.                         )
  20.                ))))
  21.  
  22. (tous_egaux '(2 2 2 2 ))
  23.  
  24.  
  25.  
  26. (
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement