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
(defun list_append(l1 l2) | |
(if (null l1) | |
l2 | |
(cons (first l1)(list_append (rest l1) l2)))) | |
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
(defun remov(elt lst) | |
(cond ((null lst) nil) | |
((equal elt (first lst))(rest lst)) | |
(elt (cons (first lst)(remov elt (rest lst)))))) | |
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
(defun exceptlast_element(user_list) | |
(reverse (cdr (reverse user_list)))) | |
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
(defun last_element(user_list) | |
(car (reverse user_list))) | |
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
(defun fact(n) | |
(if (= n 1) | |
1 | |
(* n (fact (- n 1))))) | |
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
(defun akermann(m n) | |
(cond | |
((= m 0) (+ n 1)) | |
((and (> m 0) (= n 0)) (akermann (- m 1) 1)) | |
((and (> m 0) (> n 0)) (akermann (- m 1) (akermann m (- n 1)))))) | |
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
(defun square_diff(x y) | |
(if (> x y) | |
(- (* x x) (* y y)) | |
(- (* y y) (* x x)))) | |
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
(defun square_sum(x y) | |
(+ (* x x) (* y y))) | |