foreclojure-android
foreclojure-android copied to clipboard
Null pointer @ Problem 92
The following Roman Numeral decoder (applied here to an argument for testing) works in Replete (repl app), but throws null pointer in 4clojure-android.
((fn [n] (->> n reverse (map #(get {"I" 1, "V" 5, "X" 10, "L" 50, "C" 100, "D" 500, "M" 1000} %)) (cons 0) (partition-all 2 1) (map (fn [[n1 n2]] (if (> n1 n2) (- n2) n2))) (apply +))) "XIV")