马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun a-values (code lst)
- (mapcar 'cdr
- (vl-remove-if-not '(lambda (x) (= (car x) code)) lst)
- )
- )
- (defun firstN (N L)
- (cond ((zerop N) nil)
- ((>= n (length l)) l)
- (T
- (cons
- (car L)
- (firstN (1- N) (cdr L))
- )
- )
- )
- )
- ;;(firstN 3 '(2 4 6 8 10 12))
- ;;=>(2 4 6)
- (defun nthcdr (N L)
- (cond ((zerop N) L)
- (T (nthcdr (- N 1) (cdr L)))
- )
- )
- ;;(nthcdr 3 '(4 5 6 7 8 9 ))
- ;;=> (7 8 9)
- (defun remove-member (a / ex)
- (setq ex (vl-remove (car a) a))
- (if (car a)
- (cons (car a) (remove-member ex))
- )
- )
- ;;_$ (remove-member '(1 2 2 3 2 3 4 2 1 2 3 4 2 2 4 1 2))
- ;;(1 2 3 4)
- ;;_$ (remove-member '("a" "df" "a" "we" "sf" "we" "a" "ee"))
- ;;("a" "df" "we" "sf" "ee")
- (defun vvl-remove (A L /)
- (apply 'append
- (mapcar '(lambda (x)
- (if (not (equal x A))
- (list x)
- )
- )
- L
- )
- )
- )
|