Skip to content

Instantly share code, notes, and snippets.

@sjolsen
Last active August 29, 2015 14:16
Show Gist options
  • Save sjolsen/cfca701b338592d73bd3 to your computer and use it in GitHub Desktop.
Save sjolsen/cfca701b338592d73bd3 to your computer and use it in GitHub Desktop.
(defun english-list (list)
(format nil "~{~#[the empty list~:;~
the list containing ~#[~;~
~A~;~
~A and ~A~:;~
~@{~#[~;and ~]~A~^, ~}~]~]~:}"
list))
(loop
for i from 0 to 5
for l = (loop
for j from 0 below i
collecting (format nil "~R" j))
do (format t "~@(~A~).~%" (english-list l)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment