Advertisement
Guest User

Untitled

a guest
Jan 7th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.22 KB | None | 0 0
  1. (defparameter *list* nil)
  2.  
  3. (loop :for i :in (list 1 2 3 4 5)
  4.       :do (push (lambda () (format t "~a~%" i))
  5.                 *list*))
  6.  
  7. (loop :for fn :in *list* :do (funcall fn))
  8.  
  9. ; prints:
  10. ; 5
  11. ; 5
  12. ; 5
  13. ; 5
  14. ; 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement