Created
September 1, 2011 22:25
-
-
Save shirok/1187459 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun arabic->roman (n) (if (< 0 n 4000) (format nil "~@R" n) (error "oob"))) | |
(let ((tab (loop for n from 1 to 3999 collect `(,(format nil "~@R" n) . ,n)))) | |
(defun roman->arabic (r) (or (cdr (assoc r tab :test #'equalp)) (error "huh?")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment