RosettaCodeData/Task/Roman-numerals-Decode/PicoLisp/roman-numerals-decode.l

4 lines
156 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(de roman2decimal (Rom)
(let L (replace (chop Rom) 'M 1000 'D 500 'C 100 'L 50 'X 10 'V 5 'I 1)
(sum '((A B) (if (>= A B) A (- A))) L (cdr L)) ) )