模拟状态2

来源:互联网 发布:武直10知乎 编辑:程序博客网 时间:2024/04/29 18:39

(defun  test ()
(lambda (x)
     (lambda (y)
       (if  (eq  y  'count) 
                x
            (print  y)
       )
      )
   )
)


(setq  chenbing  (test) )
(setq  a   (funcall  chenbing  5)  )


(defun  learn (n  incre now  )
(if   (<  n  0)
       (print (funcall  now  'count) )    
   (progn
       (print (funcall  now  'count) )
       (learn  (- n  1)
               incre
               (funcall  incre
                         (+  1 
                             (funcall  now  'count)))))))
(learn  10    chenbing a)