Roman numerals/Decode: Difference between revisions

Line 689:
<lang lisp>
(defun parse-roman (R)
(loop as (A B) on (loopmap as'list C(lambda across(c) R(or collect(nth (or (position c "IVXLCDM") 9) '(1 5 10 50 100 500 1000)) 0)) R)
(or (nth (or (position C "IVXLCDM") 9) '(1 5 10 50 100 500 1000)) 0))
while A sum (if (and B (< A B)) (- A) A)))
</lang>
Anonymous user