Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun dekartSpom (lista1 lista2 pomLista1)
- (cond
- ((and(null lista1)(null lista2))nil)
- ((null lista1)(dekartSpom pomLista1 (cdr lista2) lista1))
- ((not (null lista1))(cons(pom (car lista2)(car lista1))(dekartSpom (cdr lista1) lista2 pomLista1)))
- )
- )
- (defun dekartS (lista1 lista2)
- (dekartSpom lista1 lista2 lista1)
- )
- (defun pom (x y)
- (list x y)
- )
- (print(dekartS '(a b c) '(1 2)))
- ;((1 a)(1 b)(1 c)(2 a)(2 b)(2 c))
Advertisement
Add Comment
Please, Sign In to add comment