Created
December 13, 2010 12:52
-
-
Save gclaramunt/738959 to your computer and use it in GitHub Desktop.
Estilo "The Little Schemer"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* no resuelve lo que se busca, da #t si coincide algun elemento en la misma posicion en ambas listas *) | |
(define member-of-2? | |
(lambda (a lst1 lst2) | |
(cond | |
((or (null? lst1) (null? lst2) ) #f) | |
((and (eq? a (car lst1)) (eq? a (car lst2)) ) #t) | |
( else (member-of-2? a (cdr lst1) (cdr lst2) )) | |
))) | |
(* usando member? *) | |
(define member-of-2? | |
(lambda (a lst1 lst2) | |
((and (member? a lst1) (member? a lst2) )) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mas largo pero parece que funciona ;-)
https://gist.github.com/739378