Technically this is the transliteration of that ruby code:
(def severity :mild)
(def error_message "OH GOD! IT'S A DISASTER! WE'RE ")
(if (= severity :mild)
(def error_message (str error_message "MILDLY INCONVENIENCED!"))
(when (= severity :terrible)
(def error_message (str error_message "DOOOOOOOMED!"))))
And if we consider that a good transliteration then I'm not sure why this wouldn't suffice for the second one: (def failed_protagonist_names [
"Larry Potter"
"Doreen the Explorer"
"The Incredible Bulk"
])
(def failed_protagonist_names
(assoc failed_protagonist_names 0 "Gary Potter"))
;; => ["Gary Potter" "Doreen the Explorer" "The Incredible Bulk"]