Skip to content

Instantly share code, notes, and snippets.

@fchurca
fchurca / beer-song.lisp
Last active February 17, 2016 03:21 — forked from mtimkovich/beer-song.lisp
Beer song in Lisp
(defun beer-song (n)
(format t "~a bottle~:*~p of beer on the wall.~%" n)
(format t "~a bottle~:*~p of beer.~%" n)
(format t "Take one down.~%")
(format t "Pass it around.~%")
(decf n)
(if (> n 0)
(progn
; Esto nos va a ayudar a definir todos los sectores
(defmacro defsectores (&body body)
(let
((solucion (gensym)))
(labels
((sector (body) `(lambda (,solucion) ,(walk body)))
(walk (body)
(loop for clause in body collect
(if (listp clause)
(walk clause)