Created
September 1, 2011 22:34
-
-
Save shirok/1187485 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
(use srfi-1) | |
(use slib) | |
(require 'format) | |
(define (arabic->roman n) (if (< 0 n 4000) (format "~@R" n) (error "oob"))) | |
(define roman->arabic | |
(let1 tab (map (^n `(,(format "~@R" n) . ,n)) (iota 3999 1)) | |
(^r (cond [(assoc r tab string-ci=?) => cdr] [else (error "huh?")])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment