本帖最后由 redcat 于 2013-8-31 17:15 编辑
当然此项技术也可以用于动态DCL、动态识别lisp中
- (defun tt (x y) (mapcar '* x y))(tt '(4 5) '(1 2))
- (setq tt '((x y) (mapcar '* x y)))
- (tt '(4 5) '(1 2))
- (mapcar '(list '(x y) '(* x y)) '(4 5) '(1 2))
- (eval
- (read (vl-prin1-to-string
- '(mapcar '(list '(x y) '(* x y)) '(4 5) '(1 2))
- ) ;_ 结束vl-prin1-to-string
- ) ;_ 结束read
- ) ;_ 结束eval
- (eval (read (vl-prin1-to-string
- '(defun tt (x y) (mapcar '* x y))
- ) ;_ 结束vl-prin1-to-string
- ) ;_ 结束read
- ) ;_ 结束eval
- (eval (read (vl-prin1-to-string '(tt '(4 5) '(1 2)))))
- (foreach n (list
- '(defun tt (x y) (mapcar '* x y))
- '(tt '(4 5) '(1 2))
- ) ;_ 结束list
- (eval (read (vl-prin1-to-string n)))
- ) ;_ 结束foreach
- (foreach n (list
- '(defun tt (x y) (mapcar '* x y))
- '(tt '(4 5) '(1 2))
- ) ;_ 结束list
- (eval n)
- ) ;_ 结束foreach
|