Advertisement
Guest User

Untitled

a guest
Oct 1st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.47 KB | None | 0 0
  1. ;autor: Yilber Alexander Viscue
  2. ;contrato: buscar-simbolo lista simbolo --> booleano
  3. (define listas (cons 'a (cons 'b (cons 'c (cons 'd (cons 'e empty ))))))
  4.  
  5. (define (buscar-simbolo  lista sim)
  6.   (cond
  7.     [(equal? (first lista ) sim) #t]
  8.     [(equal? (first(rest lista)) sim) #t]
  9.     [(equal? (first(rest (rest lista )))sim ) #t]
  10.     [(equal? (first (rest (rest (rest lista)))) sim) #t]
  11.     [(equal? (first (rest (rest (rest (rest lista))))) sim) #t]
  12.     [else #f ]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement