1 2 3 | (defun my_second (lst) (first (rest lst)) ) |
1 2 3 4 5 6 7 8 9 10 11 | (defun my_max (x y) (if (> x y) x y) ) MY_MAX (my_max 2 5) 5 (my_max 6 1) 6 |
1 2 3 4 5 6 7 8 9 10 11 | >(defun total (x) (if (null x) 0 (+ (first x) (total (rest x))) ) ) TOTAL >(total '(1 5 1)) 7 |
1 2 3 4 5 6 7 8 | >(setf total '(lambda (a b) (+ a b))) (LAMBDA (A B) (+ A B)) >total (LAMBDA (A B) (+ A B)) >(apply total '(101 102)) 203 |
1 2 3 4 5 6 7 8 | >(defmacro times_two (x) (* 2 x)) TIMES_TWO >(setf a 4) 4 >(times_two a) 8 |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |