RosettaCodeData/Task/Scope-modifiers/Common-Lisp/scope-modifiers.lisp
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

12 lines
378 B
Common Lisp

;; *bug* shall have a dynamic binding.
(declaim (special *bug*))
(let ((shape "triangle") (*bug* "ant"))
(flet ((speak ()
(format t "~% There is some ~A in my ~A!" *bug* shape)))
(format t "~%Put ~A in your ~A..." *bug* shape)
(speak)
(let ((shape "circle") (*bug* "cockroach"))
(format t "~%Put ~A in your ~A..." *bug* shape)
(speak))))