swissChili | 7434842 | 2021-07-04 13:23:24 -0700 | [diff] [blame] | 1 | (defun mapcar (func list) |
2 | (if list | ||||
3 | (cons (apply func (list (car list))) | ||||
4 | (mapcar func (cdr list))) | ||||
5 | nil)) | ||||
6 | |||||
7 | (defun double (n) | ||||
8 | (+ n n)) | ||||
9 | |||||
swissChili | ddc9754 | 2021-07-04 11:47:42 -0700 | [diff] [blame] | 10 | (defun main () |
swissChili | 7434842 | 2021-07-04 13:23:24 -0700 | [diff] [blame] | 11 | (print (mapcar #'double |
12 | (list 1 2 3 4 5)))) |